From 64f4d6ff5d1aebd3efe5eb4b6eb97ceeb3f0b828 Mon Sep 17 00:00:00 2001 From: Till Klampaeckel Date: Wed, 22 Jan 2025 00:41:13 +0100 Subject: [PATCH] Chore(ci): publish go-generate to our registry Related: pngmbh/issues#1879 --- .github/update-cli/go-generate.yml | 23 +++++++++++++++++++++++ .github/update-cli/values.yml | 5 +++++ .github/workflows/go-generate.yml | 27 +++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 .github/update-cli/go-generate.yml create mode 100644 .github/update-cli/values.yml create mode 100644 .github/workflows/go-generate.yml diff --git a/.github/update-cli/go-generate.yml b/.github/update-cli/go-generate.yml new file mode 100644 index 0000000..f1f99ab --- /dev/null +++ b/.github/update-cli/go-generate.yml @@ -0,0 +1,23 @@ +sources: + getRelease: + kind: githubrelease + spec: + token: "{{ requiredEnv .github.token }}" + owner: paketo-community + repository: go-generate + assert: "*.cnb" + versionFilter: + kind: latest + transformers: + - trimPrefix: 'v' + +targets: + publish: + sourceid: getRelease + kind: shell + spec: + command: | + export version={{ source `getRelease` }} + skopeo copy \ + "docker-archive:https://github.com/paketo-community/go-generate/releases/download/v${version}/go-generate-${version}.cnb" \ + "docker://r.planetary-quantum.com/buildpacks/go-generate:${version}" \ No newline at end of file diff --git a/.github/update-cli/values.yml b/.github/update-cli/values.yml new file mode 100644 index 0000000..9298bf1 --- /dev/null +++ b/.github/update-cli/values.yml @@ -0,0 +1,5 @@ +github: + user: "GitHub Actions Bot" + email: "bots@udpatecli.io" + username: "github-actions" + token: "UPDATECLI_GITHUB_TOKEN" \ No newline at end of file diff --git a/.github/workflows/go-generate.yml b/.github/workflows/go-generate.yml new file mode 100644 index 0000000..64f7d73 --- /dev/null +++ b/.github/workflows/go-generate.yml @@ -0,0 +1,27 @@ +name: go-generate + +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: docker/login-action@v3 + with: + registry: r.planetary-quantum.com + username: ${{ secrets.QUANTUM_REGISTRY_USERNAME }} + password: ${{ secrets.QUANTUM_REGISTRY_PASSWORD }} + - uses: warjiang/setup-skopeo@v0.1.3 + - uses: updatecli/updatecli-action@v2 + - run: echo ${{ secrets.GITHUB_TOKEN }} + - env: + UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + updatecli \ + diff \ + -c .github/update-cli/go-generate.yml \ + -v .github/update-cli/values.yml \ No newline at end of file