v2.1.0 #66
Workflow file for this run
This file contains hidden or 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: "publish" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| publish-tauri: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: "windows-latest" | |
| args: "" | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "./app/src-tauri -> target" | |
| - name: install frontend dependencies | |
| working-directory: ./app | |
| run: npm install | |
| - uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| with: | |
| projectPath: ./app | |
| tagName: ${{ github.ref_name }} | |
| releaseName: ${{ github.ref_name }} | |
| releaseBody: "*The desktop app may be flagged as a threat by Windows Defender; however, this is a false positive. This occurs because the scripts you create with WinScript can modify system settings. Rest assured, WinScript is safe, transparent, and open-source.*" | |
| includeUpdaterJson: true | |
| updaterJsonPreferNsis: true | |
| releaseDraft: true | |
| prerelease: false | |
| args: ${{ matrix.args }} | |
| - name: Wait for release | |
| run: | | |
| sleep 5 | |
| - name: Upload Portable Executable to Release | |
| run: | | |
| ren ./app/src-tauri/target/release/winscript.exe winscript-portable.exe | |
| gh release upload ${{ github.ref_name }} ./app/src-tauri/target/release/winscript-portable.exe --clobber | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
| GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
| - name: Rename installer file in releases (Windows) | |
| shell: pwsh | |
| run: | | |
| $VERSION = "${{ github.ref_name }}" -replace "^v", "" | |
| gh release download "${{ github.ref_name }}" -p "WinScript_${VERSION}_x64-setup.exe" | |
| Rename-Item "WinScript_${VERSION}_x64-setup.exe" "winscript-installer.exe" | |
| gh release upload "${{ github.ref_name }}" "winscript-installer.exe" --clobber | |
| gh release delete-asset "${{ github.ref_name }}" "WinScript_${VERSION}_x64-setup.exe" | |
| env: | |
| GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
| - name: Modify latest.json | |
| shell: powershell | |
| run: | | |
| gh release download "${{ github.ref_name }}" -p "latest.json" | |
| $content = Get-Content -Path "latest.json" -Raw | |
| $modified = $content -replace 'WinScript_\d+\.\d+\.\d+_x64-setup\.exe', 'winscript-installer.exe' | |
| $modified | Set-Content -Path "latest.json" | |
| Get-Content -Path "latest.json" | |
| gh release upload "${{ github.ref_name }}" "latest.json" --clobber | |
| env: | |
| GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
| - name: Remove signature file | |
| run: | | |
| $VERSION = "${{ github.ref_name }}" -replace "^v", "" | |
| gh release delete-asset "${{ github.ref_name }}" "WinScript_${VERSION}_x64-setup.exe.sig" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
| GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} |