diff --git a/.github/workflows/arch-package.yml b/.github/workflows/arch-package.yml new file mode 100644 index 00000000..82751a50 --- /dev/null +++ b/.github/workflows/arch-package.yml @@ -0,0 +1,104 @@ +name: Arch package + +on: + pull_request: + paths: + - .goreleaser-cfl.yml + - .goreleaser-jtk.yml + - .github/workflows/arch-package.yml + workflow_dispatch: + +permissions: + contents: read + +jobs: + package: + runs-on: macos-15 + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + include: + - package: cfl + binary: cfl + config: .goreleaser-cfl.yml + go-mod: tools/cfl/go.mod + - package: jtk + binary: jtk + config: .goreleaser-jtk.yml + go-mod: tools/jtk/go.mod + steps: + - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0 + with: + fetch-depth: 0 + - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 + with: + go-version-file: ${{ matrix.go-mod }} + # Production release automation temporarily supplies a SemVer tag for + # cfl-v*/jtk-v* tags. Mirror that normalization in this snapshot check. + - name: Set SemVer tag for monorepo snapshot + run: git tag v0.0.0-arch-smoke + - uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3 + with: + version: v2.18.2 + args: release --snapshot --clean --skip=before --config ${{ matrix.config }} + env: + GORELEASER_CURRENT_TAG: v0.0.0-arch-smoke + - name: Verify both Arch architectures were rendered + shell: bash + run: | + set -euo pipefail + for arch in amd64 arm64; do + packages=(dist/*"${arch}.pkg.tar.zst") + test "${#packages[@]}" -eq 1 + test -f "${packages[0]}" + done + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: arch-${{ matrix.package }} + path: dist/*.pkg.tar.zst + if-no-files-found: error + + install: + needs: package + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + include: + - package: cfl + binary: cfl + config: .goreleaser-cfl.yml + go-mod: tools/cfl/go.mod + - package: jtk + binary: jtk + config: .goreleaser-jtk.yml + go-mod: tools/jtk/go.mod + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: arch-${{ matrix.package }} + path: packages + - name: Install, verify and remove in Arch Linux + env: + PACKAGE: ${{ matrix.package }} + BINARY: ${{ matrix.binary }} + shell: bash + run: | + set -euo pipefail + docker run --rm -e PACKAGE -e BINARY -v "$PWD/packages:/packages:ro" archlinux:base bash -c ' + set -euo pipefail + package=(/packages/*amd64.pkg.tar.zst) + test "${#package[@]}" -eq 1 + pacman -U --noconfirm "${package[0]}" + "$BINARY" --version + "$BINARY" --help > /tmp/cli-help + test -s /tmp/cli-help + pacman -Qo "/usr/bin/$BINARY" + pacman -Qkk "$PACKAGE" + pacman -R --noconfirm "$PACKAGE" + test ! -e "/usr/bin/$BINARY" + pacman -U --noconfirm "${package[0]}" + "$BINARY" --version + ' diff --git a/.github/workflows/auto-release-cfl.yml b/.github/workflows/auto-release-cfl.yml index 4f0a489f..b33531d6 100644 --- a/.github/workflows/auto-release-cfl.yml +++ b/.github/workflows/auto-release-cfl.yml @@ -24,13 +24,11 @@ jobs: uses: open-cli-collective/.github/.github/workflows/auto-release.yml@v1 with: working-directory: tools/cfl - # Two-stage monorepo gate: a changed file must be under a tool-path AND - # match a release-path. tool-paths scopes to cfl + shared; release-paths is - # the NARROW code-file set (NOT tools/cfl/** — that would release on a - # docs/packaging change). version.txt is unioned in and matched - # tool-relative, so tools/cfl/version.txt bumps still release. - release-paths: "**.go,go.mod,go.sum,version.txt" - tool-paths: "tools/cfl/**,shared/**" + # Scope code changes to this tool + shared, and include its root + # GoReleaser config so packaging-only changes also ship. + # version.txt is matched tool-relative for tool version bumps. + release-paths: "**.go,go.mod,go.sum,version.txt,.goreleaser-cfl.yml" + tool-paths: "tools/cfl/**,shared/**,.goreleaser-cfl.yml" # push is live (false); workflow_dispatch honors the checkbox. Compare # against both true and 'true' because a workflow_dispatch boolean input # may surface as a real boolean or the string "true" depending on context. diff --git a/.github/workflows/auto-release-jtk.yml b/.github/workflows/auto-release-jtk.yml index 60d09df2..7ab43af9 100644 --- a/.github/workflows/auto-release-jtk.yml +++ b/.github/workflows/auto-release-jtk.yml @@ -24,13 +24,11 @@ jobs: uses: open-cli-collective/.github/.github/workflows/auto-release.yml@v1 with: working-directory: tools/jtk - # Two-stage monorepo gate: a changed file must be under a tool-path AND - # match a release-path. tool-paths scopes to jtk + shared; release-paths is - # the NARROW code-file set (NOT tools/jtk/** — that would release on a - # docs/packaging change). version.txt is unioned in and matched - # tool-relative, so tools/jtk/version.txt bumps still release. - release-paths: "**.go,go.mod,go.sum,version.txt" - tool-paths: "tools/jtk/**,shared/**" + # Scope code changes to this tool + shared, and include its root + # GoReleaser config so packaging-only changes also ship. + # version.txt is matched tool-relative for tool version bumps. + release-paths: "**.go,go.mod,go.sum,version.txt,.goreleaser-jtk.yml" + tool-paths: "tools/jtk/**,shared/**,.goreleaser-jtk.yml" # push is live (false); workflow_dispatch honors the checkbox. Compare # against both true and 'true' because a workflow_dispatch boolean input # may surface as a real boolean or the string "true" depending on context. diff --git a/.goreleaser-cfl.yml b/.goreleaser-cfl.yml index 371921e4..8fec0ea0 100644 --- a/.goreleaser-cfl.yml +++ b/.goreleaser-cfl.yml @@ -102,6 +102,9 @@ nfpms: formats: - deb - rpm + - archlinux + # Keep tar entry timestamps aligned with pacman integrity metadata. + mtime: "{{ .CommitDate }}" bindir: /usr/bin contents: - src: tools/cfl/LICENSE diff --git a/.goreleaser-jtk.yml b/.goreleaser-jtk.yml index 2296e9d9..2b4783cd 100644 --- a/.goreleaser-jtk.yml +++ b/.goreleaser-jtk.yml @@ -102,6 +102,9 @@ nfpms: formats: - deb - rpm + - archlinux + # Keep tar entry timestamps aligned with pacman integrity metadata. + mtime: "{{ .CommitDate }}" bindir: /usr/bin contents: - src: tools/jtk/LICENSE diff --git a/README.md b/README.md index 4a5b4244..ea78a493 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,10 @@ make build # Binaries are in bin/ ``` +### Arch Linux / Omarchy + +Add the signed [Open CLI Collective pacman repository](https://github.com/open-cli-collective/linux-packages#arch-linux-pacman) once. Native Arch packages are published with new releases and updated by `sudo pacman -Syu`. Install with `sudo pacman -Syu cfl jtk`; executable names remain unchanged. + ## Migrating from the Old Repos If you previously installed from `jira-ticket-cli` or `confluence-cli`: