-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incorporate a semantic version generator (#313)
* Incorporate a semantic version generator * Fix script? * Another script fix * Yet another script fix * List tags * Try changing version_format * Comment out the expensive bits * Maybe need to remove this option? * Update version_format? * Remove namespace * Try echoing version again * Echo again * More echo * Generate version.txt * Update version.txt * Restore rest of build process * Code Factor * Fix zip creation
- Loading branch information
Showing
3 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters