chore: bump version to 1.1.0 #12
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: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.target }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| artifact: ak-linux-amd64 | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| artifact: ak-linux-arm64 | |
| cross: true | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| artifact: ak-darwin-amd64 | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| artifact: ak-darwin-arm64 | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| artifact: ak-windows-amd64.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross-compilation tools | |
| if: matrix.cross | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV" | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.target }} | |
| - name: Build release binary | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Rename binary (unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cp target/${{ matrix.target }}/release/ak ${{ matrix.artifact }} | |
| chmod +x ${{ matrix.artifact }} | |
| - name: Rename binary (windows) | |
| if: runner.os == 'Windows' | |
| run: cp target/${{ matrix.target }}/release/ak.exe ${{ matrix.artifact }} | |
| - name: Generate SHA256 checksum | |
| shell: bash | |
| run: | | |
| if command -v sha256sum &> /dev/null; then | |
| sha256sum ${{ matrix.artifact }} > ${{ matrix.artifact }}.sha256 | |
| else | |
| shasum -a 256 ${{ matrix.artifact }} > ${{ matrix.artifact }}.sha256 | |
| fi | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: | | |
| ${{ matrix.artifact }} | |
| ${{ matrix.artifact }}.sha256 | |
| completions: | |
| name: Generate Completions & Man Pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build CLI | |
| run: cargo build --release | |
| - name: Generate shell completions | |
| run: | | |
| mkdir -p completions | |
| target/release/ak completion bash > completions/ak.bash | |
| target/release/ak completion zsh > completions/_ak | |
| target/release/ak completion fish > completions/ak.fish | |
| target/release/ak completion powershell > completions/_ak.ps1 | |
| - name: Generate man pages | |
| run: | | |
| mkdir -p man | |
| target/release/ak man-pages man/ | |
| - name: Create completions archive | |
| run: tar czf ak-completions.tar.gz -C completions . | |
| - name: Create man pages archive | |
| run: tar czf ak-man-pages.tar.gz -C man . | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ak-completions | |
| path: ak-completions.tar.gz | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ak-man-pages | |
| path: ak-man-pages.tar.gz | |
| packages: | |
| name: Build Packages (${{ matrix.format }}-${{ matrix.arch }}) | |
| needs: [build, completions] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - format: deb | |
| arch: amd64 | |
| binary: ak-linux-amd64 | |
| - format: deb | |
| arch: arm64 | |
| binary: ak-linux-arm64 | |
| - format: rpm | |
| arch: x86_64 | |
| binary: ak-linux-amd64 | |
| - format: rpm | |
| arch: aarch64 | |
| binary: ak-linux-arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Install nfpm | |
| run: | | |
| curl -sfL "https://github.com/goreleaser/nfpm/releases/download/v2.45.0/nfpm_2.45.0_Linux_x86_64.tar.gz" -o /tmp/nfpm.tar.gz | |
| tar xzf /tmp/nfpm.tar.gz -C /usr/local/bin nfpm | |
| - name: Extract version | |
| id: version | |
| run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| - name: Prepare package tree | |
| run: | | |
| mkdir -p pkg/usr/bin pkg/usr/share/man/man1 \ | |
| pkg/usr/share/bash-completion/completions \ | |
| pkg/usr/share/zsh/vendor-completions \ | |
| pkg/usr/share/fish/vendor_completions.d \ | |
| pkg/usr/share/doc/ak \ | |
| /tmp/completions-staging | |
| cp artifacts/${{ matrix.binary }} pkg/usr/bin/ak | |
| chmod 755 pkg/usr/bin/ak | |
| tar xzf artifacts/ak-man-pages.tar.gz -C pkg/usr/share/man/man1/ | |
| tar xzf artifacts/ak-completions.tar.gz -C /tmp/completions-staging/ | |
| cp /tmp/completions-staging/ak.bash pkg/usr/share/bash-completion/completions/ak | |
| cp /tmp/completions-staging/_ak pkg/usr/share/zsh/vendor-completions/_ak | |
| cp /tmp/completions-staging/ak.fish pkg/usr/share/fish/vendor_completions.d/ak.fish | |
| cp LICENSE pkg/usr/share/doc/ak/ | |
| cp README.md pkg/usr/share/doc/ak/ | |
| - name: Create nfpm config | |
| run: | | |
| cat > nfpm.yaml <<EOF | |
| name: ak | |
| arch: "${{ matrix.arch }}" | |
| version: "${{ steps.version.outputs.version }}" | |
| maintainer: "Artifact Keeper <hello@artifactkeeper.com>" | |
| description: "CLI/TUI tool for Artifact Keeper — an enterprise artifact registry" | |
| homepage: "https://artifactkeeper.com" | |
| license: "MIT" | |
| section: "devel" | |
| priority: "optional" | |
| contents: | |
| - src: pkg/usr/bin/ak | |
| dst: /usr/bin/ak | |
| - src: pkg/usr/share/man/man1/ | |
| dst: /usr/share/man/man1/ | |
| type: tree | |
| - src: pkg/usr/share/bash-completion/completions/ak | |
| dst: /usr/share/bash-completion/completions/ak | |
| - src: pkg/usr/share/zsh/vendor-completions/_ak | |
| dst: /usr/share/zsh/vendor-completions/_ak | |
| - src: pkg/usr/share/fish/vendor_completions.d/ak.fish | |
| dst: /usr/share/fish/vendor_completions.d/ak.fish | |
| - src: pkg/usr/share/doc/ak/ | |
| dst: /usr/share/doc/ak/ | |
| type: tree | |
| EOF | |
| # nfpm is picky about indentation — strip the leading spaces from heredoc | |
| sed -i 's/^ //' nfpm.yaml | |
| - name: Build package | |
| run: nfpm pkg --packager ${{ matrix.format }} --target . | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ak-${{ matrix.format }}-${{ matrix.arch }} | |
| path: | | |
| *.deb | |
| *.rpm | |
| release: | |
| name: Create Release | |
| needs: [build, completions, packages] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| artifacts/ak-linux-* | |
| artifacts/ak-darwin-* | |
| artifacts/ak-windows-* | |
| artifacts/ak-completions.tar.gz | |
| artifacts/ak-man-pages.tar.gz | |
| artifacts/*.deb | |
| artifacts/*.rpm | |
| homebrew: | |
| name: Update Homebrew Tap | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Extract version | |
| id: version | |
| run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
| - name: Download release checksums | |
| run: | | |
| TAG="${GITHUB_REF_NAME}" | |
| BASE="https://github.com/artifact-keeper/artifact-keeper-cli/releases/download/${TAG}" | |
| for f in ak-darwin-amd64 ak-darwin-arm64 ak-linux-amd64 ak-linux-arm64; do | |
| curl -sLO "${BASE}/${f}.sha256" | |
| done | |
| - name: Parse checksums | |
| id: sums | |
| run: | | |
| echo "darwin_amd64=$(awk '{print $1}' ak-darwin-amd64.sha256)" >> "$GITHUB_OUTPUT" | |
| echo "darwin_arm64=$(awk '{print $1}' ak-darwin-arm64.sha256)" >> "$GITHUB_OUTPUT" | |
| echo "linux_amd64=$(awk '{print $1}' ak-linux-amd64.sha256)" >> "$GITHUB_OUTPUT" | |
| echo "linux_arm64=$(awk '{print $1}' ak-linux-arm64.sha256)" >> "$GITHUB_OUTPUT" | |
| - name: Generate Homebrew formula | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| TAG="${GITHUB_REF_NAME}" | |
| BASE="https://github.com/artifact-keeper/artifact-keeper-cli/releases/download/${TAG}" | |
| mkdir -p Formula | |
| cat > Formula/ak.rb << FORMULA | |
| class Ak < Formula | |
| desc "CLI/TUI tool for Artifact Keeper — an enterprise artifact registry" | |
| homepage "https://artifactkeeper.com" | |
| version "${VERSION}" | |
| license "MIT" | |
| on_macos do | |
| if Hardware::CPU.arm? | |
| url "${BASE}/ak-darwin-arm64" | |
| sha256 "${{ steps.sums.outputs.darwin_arm64 }}" | |
| else | |
| url "${BASE}/ak-darwin-amd64" | |
| sha256 "${{ steps.sums.outputs.darwin_amd64 }}" | |
| end | |
| end | |
| on_linux do | |
| if Hardware::CPU.arm? | |
| url "${BASE}/ak-linux-arm64" | |
| sha256 "${{ steps.sums.outputs.linux_arm64 }}" | |
| else | |
| url "${BASE}/ak-linux-amd64" | |
| sha256 "${{ steps.sums.outputs.linux_amd64 }}" | |
| end | |
| end | |
| def install | |
| bin.install Dir["ak*"].first => "ak" | |
| end | |
| test do | |
| assert_match "ak #{version}", shell_output("#{bin}/ak --version") | |
| end | |
| end | |
| FORMULA | |
| - name: Push to Homebrew tap | |
| uses: cpina/github-action-push-to-another-repository@main | |
| env: | |
| SSH_DEPLOY_KEY: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }} | |
| with: | |
| source-directory: Formula | |
| destination-github-username: artifact-keeper | |
| destination-repository-name: homebrew-tap | |
| target-directory: Formula | |
| user-email: "github-actions[bot]@users.noreply.github.com" | |
| user-name: "github-actions[bot]" | |
| commit-message: "Update ak formula to ${{ steps.version.outputs.version }}" | |
| target-branch: main | |
| snap: | |
| name: Publish to Snap Store | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: snapcore/action-build@v1 | |
| id: build | |
| - uses: snapcore/action-publish@v1 | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_TOKEN }} | |
| with: | |
| snap: ${{ steps.build.outputs.snap }} | |
| release: stable |