mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 03:08:09 -06:00
changed release workflow from releasing snapshot versions to "stable" versions. More info at https://github.com/MCV-Software/TWBlue/pull/567
This commit is contained in:
parent
8d93c170e2
commit
275f5e763b
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
@ -3,12 +3,13 @@
|
|||||||
name: Release
|
name: Release
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
tags: ["release"]
|
||||||
- next-gen
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Builds an x64 binary and an installer of TW Blue.
|
# Builds an x64 binary and an installer of TW Blue.
|
||||||
runs-on: windows-2019
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: clone repo
|
- name: clone repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -22,14 +23,6 @@ jobs:
|
|||||||
- name: Install python packages
|
- name: Install python packages
|
||||||
run: python -m pip install -r requirements.txt
|
run: python -m pip install -r requirements.txt
|
||||||
|
|
||||||
- name: Get nsis
|
|
||||||
run: |
|
|
||||||
iwr -useb get.scoop.sh -outfile 'install.ps1'
|
|
||||||
.\install.ps1 -RunAsAdmin
|
|
||||||
scoop update
|
|
||||||
scoop bucket add extras
|
|
||||||
scoop install nsis
|
|
||||||
|
|
||||||
- name: Build binary
|
- name: Build binary
|
||||||
run: |
|
run: |
|
||||||
.\scripts\build.ps1
|
.\scripts\build.ps1
|
||||||
@ -37,12 +30,14 @@ jobs:
|
|||||||
|
|
||||||
- name: make installer
|
- name: make installer
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd scripts
|
||||||
python write_version_data.py
|
|
||||||
cd ../scripts
|
|
||||||
makensis twblue.nsi
|
makensis twblue.nsi
|
||||||
|
|
||||||
- name: Create new release
|
- name: Create new release
|
||||||
env:
|
env:
|
||||||
gh_token: ${{ github.token }}
|
gh_token: ${{ github.token }}
|
||||||
run: gh release create snapshot -n "This release is a snapshot of the current development version of twblue." -p -t "Snapshot" scripts\TWBlue_setup.exe
|
run: |
|
||||||
|
mkdir .release-assets
|
||||||
|
mv scripts\TWBlue_setup.exe .release-assets\TWBlue_setup_$(cat version.txt).exe
|
||||||
|
7z a -tzip .release-assets\TWBlue_portable_$(cat version.txt).zip scripts\TWBlue64
|
||||||
|
gh release create release -p -t "Version $(cat version.txt)" .release-assets\TWBlue_setup_$(cat version.txt).exe .release-assets\TWBlue_portable_$(cat version.txt).zip
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -20,4 +20,5 @@ release-snapshot/
|
|||||||
src/com_cache/
|
src/com_cache/
|
||||||
doc/strings.py
|
doc/strings.py
|
||||||
doc/changelog.py
|
doc/changelog.py
|
||||||
env/
|
env/
|
||||||
|
version.txt
|
||||||
|
@ -10,6 +10,7 @@ echo "done."
|
|||||||
|
|
||||||
echo "Building binary..."
|
echo "Building binary..."
|
||||||
cd src
|
cd src
|
||||||
|
python write_version_data.py
|
||||||
python setup.py build
|
python setup.py build
|
||||||
cd ..
|
cd ..
|
||||||
echo "done."
|
echo "done."
|
||||||
|
@ -10,9 +10,10 @@ commit_info = requests.get("https://gitlab.com/api/v4/projects/23482196/reposito
|
|||||||
commit_info = commit_info.json()
|
commit_info = commit_info.json()
|
||||||
commit = commit_info["short_id"]
|
commit = commit_info["short_id"]
|
||||||
print("Got new version info: {commit}".format(commit=commit,))
|
print("Got new version info: {commit}".format(commit=commit,))
|
||||||
|
new_version = commit_info["created_at"][:10].replace("-", ".")
|
||||||
file = open("application.py", "r", encoding="utf-8")
|
file = open("application.py", "r", encoding="utf-8")
|
||||||
lines = file.readlines()
|
lines = file.readlines()
|
||||||
lines[-1] = 'version = "{}"'.format(commit_info["created_at"][:10].replace("-", "."))
|
lines[-1] = 'version = "{}"'.format(new_version)
|
||||||
file.close()
|
file.close()
|
||||||
file2 = open("application.py", "w", encoding="utf-8")
|
file2 = open("application.py", "w", encoding="utf-8")
|
||||||
file2.writelines(lines)
|
file2.writelines(lines)
|
||||||
@ -22,9 +23,15 @@ print("Wrote application.py with the new version info.")
|
|||||||
print("Updating next version on installer setup...")
|
print("Updating next version on installer setup...")
|
||||||
file = open("..\\scripts\\twblue.nsi", "r", encoding="utf-8")
|
file = open("..\\scripts\\twblue.nsi", "r", encoding="utf-8")
|
||||||
contents = file.read()
|
contents = file.read()
|
||||||
contents = contents.replace("0.95", commit_info["created_at"][:10].replace("-", "."))
|
contents = contents.replace("0.95", new_version)
|
||||||
file.close()
|
file.close()
|
||||||
file2 = open("..\\scripts\\twblue.nsi", "w", encoding="utf-8")
|
file2 = open("..\\scripts\\twblue.nsi", "w", encoding="utf-8")
|
||||||
file2.write(contents)
|
file2.write(contents)
|
||||||
file2.close()
|
file2.close()
|
||||||
print("done")
|
print("done")
|
||||||
|
|
||||||
|
print("Writing new version to version.txt")
|
||||||
|
version_txt = open("../version.txt", "w", encoding="utf8")
|
||||||
|
version_txt.write(new_version)
|
||||||
|
version_txt.close()
|
||||||
|
print("Done.")
|
||||||
|
Loading…
Reference in New Issue
Block a user