git-xet release, tag main #105
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: git-xet Release | |
| run-name: git-xet release, tag ${{ inputs.tag || 'main' }} | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Semantic version for release (tag will shard the same name)" | |
| required: true | |
| default: "v0.1.0" | |
| permissions: | |
| contents: read | |
| jobs: | |
| linux: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: ubuntu-22.04 | |
| target: x86_64 | |
| - runner: ubuntu-22.04-arm | |
| target: aarch64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust 1.89 | |
| uses: dtolnay/[email protected] | |
| - uses: ./.github/actions/cache-rust-build | |
| - name: Build | |
| run: | | |
| cargo build --release | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: git-xet-linux-${{ matrix.platform.target }} | |
| path: target/release/git-xet | |
| macos: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: macos-15-intel | |
| target: x86_64 | |
| - runner: macos-15 | |
| target: aarch64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust 1.89 | |
| uses: dtolnay/[email protected] | |
| - uses: ./.github/actions/cache-rust-build | |
| - name: Build | |
| run: | | |
| cargo build --release | |
| mkdir dist | |
| cp target/release/git-xet dist/ | |
| cp git_xet/entitlements.xml dist/ | |
| - name: Codesign and Notarization | |
| uses: lando/code-sign-action@v3 | |
| with: | |
| file: dist/git-xet | |
| certificate-data: ${{ secrets.CLI_MACOS_CERTIFICATE }} | |
| certificate-id: ${{ secrets.CLI_MACOS_TEAM_ID }} | |
| certificate-password: ${{ secrets.CLI_MACOS_CERTIFICATE_PWD }} | |
| apple-notary-user: ${{ secrets.CLI_MACOS_NOTARY_USER }} | |
| apple-notary-password: ${{ secrets.CLI_MACOS_NOTARY_PWD }} | |
| apple-product-id: co.huggingface.gitxet | |
| options: --options runtime --entitlements dist/entitlements.xml | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: git-xet-macos-${{ matrix.platform.target }} | |
| path: dist/git-xet | |
| windows: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: windows-latest | |
| target: x86_64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust 1.89 | |
| uses: dtolnay/[email protected] | |
| - uses: ./.github/actions/cache-rust-build | |
| - name: Install WiX | |
| run: | | |
| dotnet tool install --global wix | |
| - name: Build | |
| run: | | |
| cargo build --release | |
| mkdir dist | |
| cp target/release/git-xet.exe dist/ | |
| - name: Codesign the executable file | |
| uses: ./.github/actions/windows-codesign | |
| with: | |
| file: ${{ github.workspace }}\dist\git-xet.exe | |
| azure_tenant_id: ${{ secrets.AZURE_TENANT_ID }} | |
| azure_client_id: ${{ secrets.AZURE_CLIENT_ID }} | |
| azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| - name: Build installer | |
| run: | | |
| cp git_xet/windows_installer/Package.wxs dist/ | |
| cd dist | |
| wix build Package.wxs -o bin\git-xet-windows-installer -arch x64 | |
| - name: Codesign the installer | |
| uses: ./.github/actions/windows-codesign | |
| with: | |
| file: ${{ github.workspace }}\dist\bin\git-xet-windows-installer.msi | |
| azure_tenant_id: ${{ secrets.AZURE_TENANT_ID }} | |
| azure_client_id: ${{ secrets.AZURE_CLIENT_ID }} | |
| azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: git-xet-windows-${{ matrix.platform.target }} | |
| path: dist/git-xet.exe | |
| - name: Upload installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: git-xet-windows-installer-${{ matrix.platform.target }} | |
| path: dist/bin/git-xet-windows-installer.msi | |
| github-release: | |
| name: Create GitHub release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| needs: [linux, windows, macos] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| path: dist | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| ls -l dist | |
| for dir in dist/*; do (cd "$dir" && zip -r "../$(basename "$dir").zip" .); done | |
| gh release create git-xet-${{ github.event.inputs.tag}} dist/*.zip --generate-notes --prerelease --target ${{github.sha}} |