diff --git a/.github/workflows/windows_build_test_and_push.yml b/.github/workflows/windows_build_test_and_push.yml index 8db6313b..e0f8334c 100644 --- a/.github/workflows/windows_build_test_and_push.yml +++ b/.github/workflows/windows_build_test_and_push.yml @@ -31,6 +31,50 @@ jobs: git -c submodule."external/commonItems".update=none ` submodule update --init --recursive external\Fronter + - name: "Generate semantic version number" + uses: paulhatch/semantic-version@v5.0.2 + id: version_number + with: + # The prefix to use to identify tags + tag_prefix: "v" + # A string which, if present in a git commit, indicates that a change represents a + # major (breaking) change, supports regular expressions wrapped with '/' + major_pattern: "(MAJOR)" + # A string which indicates the flags used by the `major_pattern` regular expression. Supported flags: idgs + major_regexp_flags: "" + # Same as above except indicating a minor change, supports regular expressions wrapped with '/' + minor_pattern: "(MINOR)" + # A string which indicates the flags used by the `minor_pattern` regular expression. Supported flags: idgs + minor_regexp_flags: "" + # A string to determine the format of the version output + version_format: "v${major}.${minor}.${patch}" + # If this is set to true, *every* commit will be treated as a new version. + bump_each_commit: true + # If true, the body of commits will also be searched for major/minor patterns to determine the version type. + search_commit_body: false + # The output method used to generate list of users, 'csv' or 'json'. + user_format_type: "csv" + + - name: "Echo version number" + run: | + echo ${{ steps.version_number.outputs.major }} + echo ${{ steps.version_number.outputs.minor }} + echo ${{ steps.version_number.outputs.patch }} + + - name: "Create version file" + run: | + echo '# Version info' > data/version.txt + echo '' >> data/version.txt + echo 'version = "${{ steps.version_number.outputs.major }}.${{ steps.version_number.outputs.minor }}.${{ steps.version_number.outputs.patch }}"' >> data/version.txt + echo 'name = "Null"' >> data/version.txt + echo 'source = "Vic3"' >> data/version.txt + echo 'minSource = "1.0"' >> data/version.txt + echo 'maxSource = "1.2"' >> data/version.txt + echo 'target = "HoI4"' >> data/version.txt + echo 'minTarget = "1.12"' >> data/version.txt + echo 'maxTarget = "1.12"' >> data/version.txt + cat data/version.txt + - name: "Build solution" run: | cd "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\" @@ -44,23 +88,23 @@ jobs: - name: "Prepare release" run: | cd "C:\Program Files\7-Zip\" - .\7z.exe a $Env:GITHUB_WORKSPACE\Vic3ToHoI4-0.0Null-win-x64.zip $Env:GITHUB_WORKSPACE\build\Release\* + .\7z.exe a $Env:GITHUB_WORKSPACE\Vic3ToHoI4-${{ steps.version_number.outputs.major }}.${{ steps.version_number.outputs.minor }}-win-x64.zip $Env:GITHUB_WORKSPACE\build\Release\* .\7z.exe a $Env:GITHUB_WORKSPACE\Vic3ToHoI4-latest-win-x64.zip $Env:GITHUB_WORKSPACE\build\Release\* - name: "Prepare installer" run: | c:\"Program Files (x86)\Inno Setup 6\iscc" Vic3ToHoI4-Installer.iss - cp $Env:GITHUB_WORKSPACE\Output\Vic3ToHoI4-latest-win-x64.exe $Env:GITHUB_WORKSPACE\Output\Vic3ToHoI4-0.0Null-win-x64.exe + cp $Env:GITHUB_WORKSPACE\Output\Vic3ToHoI4-latest-win-x64.exe $Env:GITHUB_WORKSPACE\Output\Vic3ToHoI4-${{ steps.version_number.outputs.major }}.${{ steps.version_number.outputs.minor }}-win-x64.exe - name: "Upload binaries to named release" if: ${{ github.event_name == 'push' }} uses: ncipollo/release-action@v1 with: - tag: 0.0Null + tag: ${{ steps.version_number.outputs.major }}.${{ steps.version_number.outputs.minor }}.0 allowUpdates: true omitBodyDuringUpdate: true omitNameDuringUpdate: true - artifacts: Vic3ToHoI4-0.0Null-win-x64.zip, Output\Vic3ToHoI4-0.0Null-win-x64.exe + artifacts: Vic3ToHoI4-${{ steps.version_number.outputs.major }}.${{ steps.version_number.outputs.minor }}-win-x64.zip, Output\Vic3ToHoI4-${{ steps.version_number.outputs.major }}.${{ steps.version_number.outputs.minor }}-win-x64.exe token: ${{ secrets.API_TOKEN_GITHUB }} - name: "Upload binaries to latest release" diff --git a/data/version.txt b/data/version.txt index 870abec7..fb1b2487 100644 --- a/data/version.txt +++ b/data/version.txt @@ -1,10 +1,10 @@ # Version info -version = "0.0" +version = "0.0.0" name = "Null" source = "Vic3" minSource = "1.0" -maxSource = "1.0" +maxSource = "1.2" target = "HoI4" -minTarget = "1.11.4" +minTarget = "1.12" maxTarget = "1.12" diff --git a/docs/release_checklist.txt b/docs/release_checklist.txt index ea525c9e..dc707f7f 100644 --- a/docs/release_checklist.txt +++ b/docs/release_checklist.txt @@ -1,7 +1,7 @@ * Add new banner to data/resources/images -* Create new tag on github * Update data/version.txt with new version and name -* Update .github/workflows/windows_build_test_and_push.yml with new filename, tag, and artifact +* Update .github/workflows/windows_build_test_and_push.yml with new name, filename, tag, and artifact +* Create commit with MINOR or MAJOR in the commit message as appropriate, and tagged with new version * Push and merge on github * Wait for build, confirm updates * New post on forum thread