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 Workflow | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
release: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
- name: Extract tag name | |
run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Update package.version in tauri.conf.json | |
run: | | |
$json = Get-Content -Path "src-tauri\tauri.conf.json" -Raw | ConvertFrom-Json | |
$json.package.version = "${{ env.TAG_NAME }}" | |
$json | ConvertTo-Json -Depth 100 | Set-Content -Path "src-tauri\tauri.conf.json" | |
npx -y prettier .\src-tauri\tauri.conf.json --write | |
- name: Install Rust stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install dependencies and build | |
env: | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
run: | | |
npm i | |
npm run tauri build | |
- name: Create Release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ env.TAG_NAME }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: .\src-tauri\target\release\bundle\msi\Launcherg_${{ env.TAG_NAME }}_x64_ja-JP.msi.zip | |
asset_name: Launcherg_${{ env.TAG_NAME }}_x64_ja-JP.msi.zip | |
asset_content_type: application/zip | |
- name: Update .tauri-updater.json | |
run: | | |
$data = @{ | |
version = "${{ env.TAG_NAME }}" | |
notes = "See the assets to download this version and install." | |
pub_date = (Get-Date -Format s) + "Z" | |
signature = ".\src-tauri\target\release\bundle\msi\Launcherg_${{ env.TAG_NAME }}_x64_ja-JP.msi.zip" | |
url = ${{ steps.upload-release-asset.outputs.browser_download_url }} | |
} | |
$data | ConvertTo-Json | Set-Content -Path ".tauri-updater.json" | |
npx -y prettier .tauri-updater.json --write | |
- name: Push updated files to main | |
run: | | |
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git add src-tauri\tauri.conf.json | |
git add .tauri-updater.json | |
git commit -m "Update for release ${{ env.TAG_NAME }}" | |
git push origin main |