Merge branch 'master' of https://github.com/CrimsonMods/JSONRising in… #11
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: Build | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
permissions: | |
contents: write | |
jobs: | |
build-tauri: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Install WASM Tools | |
run: dotnet workload install wasm-tools | |
- name: Install Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install frontend dependencies | |
run: dotnet restore | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v0.9.11 | |
with: | |
versionSpec: "5.x" | |
- name: Determine Version | |
uses: gittools/actions/gitversion/execute@v0.9.7 | |
id: gitversion | |
- name: Update Changelog Version | |
run: | | |
$content = Get-Content CHANGELOG.md -Raw | |
$content = $content -replace "latest", "${{ env.GitVersion_SemVer }}" | |
Set-Content CHANGELOG.md -Value $content | |
shell: pwsh | |
- name: Update Tauri Config Version | |
run: | | |
$content = Get-Content src-tauri/tauri.conf.json -Raw | |
$content = $content -replace '"version": "0.0.0"', "`"version`": `"${{ env.GitVersion_SemVer }}`"" | |
Set-Content src-tauri/tauri.conf.json -Value $content | |
shell: pwsh | |
- name: Build Tauri app | |
uses: tauri-apps/tauri-action@v0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PACKAGE_VERSION: ${{ env.GitVersion_SemVer }} | |
with: | |
releaseId: ${{env.GitVersion_SemVer}} | |
tagName: v${{ env.GitVersion_SemVer }} | |
releaseName: v${{ env.GitVersion_SemVer }} | |
releaseBody: "See the assets to download this version and install." | |
releaseDraft: true | |
prerelease: false | |
- name: GH Release | |
uses: softprops/action-gh-release@v1 | |
if: ${{ !env.ACT && github.event_name == 'push' }} | |
with: | |
body: Automatic pre-release of ${{ env.GitVersion_SemVer }} for ${{ env.GitVersion_ShortSha }} | |
name: v${{ env.GitVersion_SemVer }} | |
files: | | |
./src-tauri/target/release/bundle/nsis/*.exe | |
CHANGELOG.md | |
fail_on_unmatched_files: true | |
prerelease: true | |
tag_name: v${{ env.GitVersion_SemVer }} |