|
| 1 | +# |
| 2 | +# REF: |
| 3 | +# 1. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude |
| 4 | +# |
| 5 | +name: Build Windows MSI |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + tag: |
| 11 | + required: true |
| 12 | + description: 'Tag to Rebuild MSI' |
| 13 | + |
| 14 | +defaults: |
| 15 | + run: |
| 16 | + shell: bash |
| 17 | + |
| 18 | +jobs: |
| 19 | + release: |
| 20 | + name: Nu |
| 21 | + |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + target: |
| 26 | + - x86_64-pc-windows-msvc |
| 27 | + - aarch64-pc-windows-msvc |
| 28 | + extra: ['bin'] |
| 29 | + |
| 30 | + include: |
| 31 | + - target: x86_64-pc-windows-msvc |
| 32 | + os: windows-latest |
| 33 | + - target: aarch64-pc-windows-msvc |
| 34 | + os: windows-11-arm |
| 35 | + |
| 36 | + runs-on: ${{ matrix.os }} |
| 37 | + |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Install Wix Toolset 6 for Windows |
| 42 | + shell: pwsh |
| 43 | + if: ${{ startsWith(matrix.os, 'windows') }} |
| 44 | + run: | |
| 45 | + dotnet tool install --global wix --version 6.0.0 |
| 46 | + dotnet workload install wix |
| 47 | + $wixPath = "$env:USERPROFILE\.dotnet\tools" |
| 48 | + echo "$wixPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append |
| 49 | + $env:PATH = "$wixPath;$env:PATH" |
| 50 | + wix --version |
| 51 | +
|
| 52 | + - name: Setup Nushell |
| 53 | + uses: hustcer/setup-nu@v3 |
| 54 | + with: |
| 55 | + version: nightly |
| 56 | + |
| 57 | + - name: Release MSI Packages |
| 58 | + id: nu |
| 59 | + run: nu .github/workflows/release-msi.nu |
| 60 | + env: |
| 61 | + OS: ${{ matrix.os }} |
| 62 | + REF: ${{ inputs.tag }} |
| 63 | + TARGET: ${{ matrix.target }} |
| 64 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 65 | + |
| 66 | + # REF: https://github.com/marketplace/actions/gh-release |
| 67 | + - name: Publish Archive |
| 68 | + uses: softprops/action-gh-release@v2.0.5 |
| 69 | + with: |
| 70 | + tag_name: ${{ inputs.tag }} |
| 71 | + files: ${{ steps.nu.outputs.msi }} |
| 72 | + env: |
| 73 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 74 | + |
| 75 | + sha256sum: |
| 76 | + needs: release |
| 77 | + name: Create Sha256sum |
| 78 | + runs-on: ubuntu-latest |
| 79 | + steps: |
| 80 | + - name: Download Release Archives |
| 81 | + env: |
| 82 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 83 | + run: >- |
| 84 | + gh release download ${{ inputs.tag }} |
| 85 | + --repo ${{ github.repository }} |
| 86 | + --pattern '*' |
| 87 | + --dir release |
| 88 | + - name: Create Checksums |
| 89 | + run: cd release && rm -f SHA256SUMS && shasum -a 256 * > ../SHA256SUMS |
| 90 | + - name: Publish Checksums |
| 91 | + uses: softprops/action-gh-release@v2.0.5 |
| 92 | + with: |
| 93 | + files: SHA256SUMS |
| 94 | + tag_name: ${{ inputs.tag }} |
| 95 | + env: |
| 96 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments