diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa05694..043f4f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,29 +12,39 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: go-version-file: go.mod - cache: true + cache: false - name: Configure Go private modules run: git config --global url."https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/" - - - name: Install wfctl v0.63.2 + - name: Install wfctl v0.74.6 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WFCTL_VERSION: v0.74.6 run: | + set -euo pipefail + runner_arch=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') + asset="wfctl-linux-${runner_arch}" + download_dir="$(mktemp -d)" + gh release download "${WFCTL_VERSION}" \ + --repo GoCodeAlone/workflow \ + --pattern "${asset}" \ + --pattern checksums.txt \ + --dir "${download_dir}" + (cd "${download_dir}" && grep " ${asset}$" checksums.txt | sha256sum -c -) mkdir -p "${RUNNER_TEMP}/wfctl-bin" - curl -sSfL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -o "${RUNNER_TEMP}/wfctl-bin/wfctl" \ - "https://github.com/GoCodeAlone/workflow/releases/download/v0.63.2/wfctl-linux-amd64" - chmod +x "${RUNNER_TEMP}/wfctl-bin/wfctl" + install -m 0755 "${download_dir}/${asset}" "${RUNNER_TEMP}/wfctl-bin/wfctl" + echo "${RUNNER_TEMP}/wfctl-bin" >> "$GITHUB_PATH" - name: Validate plugin contract for publish (pre-build) - run: "${{ runner.temp }}/wfctl-bin/wfctl plugin validate-contract --for-publish --tag ${{ github.ref_name }} ." + run: "wfctl plugin validate-contract --for-publish --tag ${{ github.ref_name }} ." - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v7 + uses: goreleaser/goreleaser-action@5daf1e915a5f0af01ddbcd89a43b8061ff4f1a89 # v7.2.2 with: version: "~> v2" args: release --clean @@ -54,9 +64,9 @@ jobs: jq '.[] | {name, type, goos, goarch, path}' dist/artifacts.json exit 0 fi - "${{ runner.temp }}/wfctl-bin/wfctl" plugin verify-capabilities --binary "$BIN" . + "wfctl" plugin verify-capabilities --binary "$BIN" . - name: Verify shipped plugin.json carries tag (post-build) - run: '"${{ runner.temp }}/wfctl-bin/wfctl" plugin validate-contract --for-publish --tag ${{ github.ref_name }} --release-dir . .' + run: '"wfctl" plugin validate-contract --for-publish --tag ${{ github.ref_name }} --release-dir . .' - name: Publish GitHub release if: ${{ success() }} env: @@ -75,7 +85,7 @@ jobs: && github.repository == 'GoCodeAlone/workflow-plugin-infra' steps: - name: Trigger registry manifest sync - uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4 + uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1 with: token: ${{ secrets.repo_dispatch_token }} repository: GoCodeAlone/workflow-registry diff --git a/go.mod b/go.mod index 63f9e12..a78e46e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/GoCodeAlone/workflow-plugin-infra -go 1.26.0 +go 1.26.4 require ( github.com/GoCodeAlone/workflow v0.72.0