Bump version number (for real this time) #32
Workflow file for this run
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
name: Release new version | |
on: | |
push: | |
tags: | |
- v*.*.* | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Create environment variables | |
run: | | |
$versionPrefix = "refs/tags/v" | |
$version = $env:GITHUB_REF.Substring($versionPrefix.Length) | |
$commitSha = (git rev-parse --short $env:GITHUB_SHA) | |
echo "NGPLUS_COMMIT_SHA=${commitSha}" | Out-File -FilePath $env:GITHUB_ENV -Encoding UTF8 -Append | |
echo "NGPLUS_VERSION=${version}" | Out-File -FilePath $env:GITHUB_ENV -Encoding UTF8 -Append | |
echo "NGPLUS_COMMITS_SINCE_LAST_TAG=${changes} | Out-File -FilePath $env:GITHUB_ENV -Encoding UTF8 -Append" | |
- name: Setup XMake | |
uses: xmake-io/github-action-setup-xmake@v1 | |
with: | |
xmake-version: latest | |
- name: Update XMake repo | |
run: xmake.exe repo --update | |
- name: Configure XMake and install dependencies | |
run: xmake.exe config --yes | |
- name: Build and bundle with XMake | |
run: xmake.exe package | |
- name: Prepare ZIP | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
# Create the ZIP files. | |
7z a NewGamePlus_${env:NGPLUS_VERSION}.zip packaging/* | |
7z a NewGamePlus_${env:NGPLUS_VERSION}_pdb.zip packaging_pdb/* | |
- name: Generate hash for .zip | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
$hash = Get-FileHash -Algorithm SHA256 -Path NewGamePlus_${env:NGPLUS_VERSION}.zip | |
$hash | Format-List | |
$only_hash = $hash | ForEach-Object { $_.Hash } | |
echo "NGPLUS_SHA256=${only_hash}" | Out-File -FilePath $env:GITHUB_ENV -Encoding UTF8 -Append | |
- name: Upload build to releases | |
uses: softprops/[email protected] | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
append_body: true | |
body: | | |
### SHA256 of release: | |
- ${{env.NGPLUS_SHA256}} | |
files: | | |
NewGamePlus_${{env.NGPLUS_VERSION }}.zip | |
NewGamePlus_${{env.NGPLUS_VERSION }}_pdb.zip |