fix(email): pointing to EFD vs productivity panel api (#232) #117
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: Release | |
| # Cuts real semver GitHub Releases for the `gddy` binary via release-please, | |
| # then builds and attaches multi-platform archives to the release it creates. | |
| # | |
| # Targets `main` — see release-please-config.json and | |
| # .release-please-manifest.json for the release-please state this depends on. | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| publish_only: | |
| description: "Skip release-please, run build+attach directly against the latest release (for retrying a failed publish)" | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| jobs: | |
| release-please: | |
| name: Release Please | |
| runs-on: ubuntu-latest | |
| outputs: | |
| releases_created: ${{ steps.release.outputs.releases_created }} | |
| tag_name: ${{ steps.release.outputs['rust--tag_name'] }} | |
| steps: | |
| - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 #v5.0.0 | |
| id: release | |
| if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.publish_only) }} | |
| with: | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| target-branch: main | |
| build: | |
| name: Build ${{ matrix.target }} | |
| needs: release-please | |
| if: needs.release-please.outputs.releases_created == 'true' || (github.event_name == 'workflow_dispatch' && inputs.publish_only == true) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| cross: true | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| defaults: | |
| run: | |
| working-directory: rust | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache cargo | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| rust/target | |
| key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('rust/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-${{ matrix.target }}-cargo- | |
| - name: Install cross | |
| if: matrix.cross == true | |
| run: cargo install cross --locked | |
| - name: Build | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.cross }}" = "true" ]; then | |
| cross build --release --target ${{ matrix.target }} | |
| else | |
| cargo build --release --target ${{ matrix.target }} | |
| fi | |
| - name: Package gddy | |
| shell: bash | |
| run: | | |
| TARGET="${{ matrix.target }}" | |
| ARCHIVE="gddy-${TARGET}" | |
| mkdir -p staging | |
| if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
| cp "target/${TARGET}/release/gddy.exe" "staging/gddy.exe" | |
| (cd staging && 7z a "../${ARCHIVE}.zip" gddy.exe) | |
| echo "ASSET=rust/${ARCHIVE}.zip" >> "$GITHUB_ENV" | |
| else | |
| cp "target/${TARGET}/release/gddy" "staging/gddy" | |
| chmod 755 "staging/gddy" | |
| tar -czf "${ARCHIVE}.tar.gz" -C staging gddy | |
| echo "ASSET=rust/${ARCHIVE}.tar.gz" >> "$GITHUB_ENV" | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: ${{ matrix.target }} | |
| path: ${{ env.ASSET }} | |
| attach: | |
| name: Attach release assets | |
| needs: [release-please, build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| cd dist | |
| sha256sum gddy-*.tar.gz gddy-*.zip > gddy-checksums-sha256.txt | |
| - name: Attach assets to the release-please release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # Release is a draft (release-please-config.json) so `latest` never | |
| # points at it until every asset is attached — avoids a 404 window. | |
| TAG="${{ needs.release-please.outputs.tag_name }}" | |
| if [ -z "$TAG" ]; then | |
| # publish_only retry path has no tag_name: pick the newest *draft* | |
| # only (never a published release) and fail fast if none exists. | |
| TAG="$(gh release list --limit 30 --json tagName,isDraft \ | |
| --jq 'map(select(.isDraft)) | .[0].tagName // empty')" | |
| if [ -z "$TAG" ]; then | |
| echo "No draft release found to publish." >&2 | |
| exit 1 | |
| fi | |
| fi | |
| gh release upload "$TAG" \ | |
| dist/gddy-*.tar.gz \ | |
| dist/gddy-*.zip \ | |
| dist/gddy-checksums-sha256.txt \ | |
| install.sh \ | |
| install.ps1 \ | |
| --clobber | |
| # Publish only now assets are complete; stays a draft if build fails. | |
| gh release edit "$TAG" --draft=false --latest |