|
1 | 1 | name: Release |
2 | 2 | on: |
3 | | - release: |
4 | | - types: |
5 | | - - published |
| 3 | + release: |
| 4 | + types: |
| 5 | + - published |
6 | 6 | jobs: |
7 | | - register: |
8 | | - name: Package, Publish, and Register |
9 | | - runs-on: |
10 | | - - ubuntu-latest |
11 | | - steps: |
12 | | - - id: checkout |
13 | | - name: Checkout code |
14 | | - uses: actions/checkout@v2 |
15 | | - - if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} |
16 | | - name: Login to GitHub Package Registry |
17 | | - uses: docker/login-action@v1 |
18 | | - with: |
19 | | - registry: ghcr.io |
20 | | - username: ${{ github.repository_owner }} |
21 | | - password: ${{ secrets.GHCR_TOKEN }} |
22 | | - - id: setup-pack |
23 | | - uses: buildpacks/github-actions/setup-pack@v4.1.0 |
24 | | - - id: package |
25 | | - run: | |
26 | | - #!/usr/bin/env bash |
27 | | - set -euo pipefail |
28 | | - BP_ID="$(cat buildpack.toml | yj -t | jq -r .buildpack.id)" |
29 | | - VERSION="$(cat buildpack.toml | yj -t | jq -r .buildpack.version)" |
30 | | - PACKAGE="${REPO}/$(echo "$BP_ID" | sed 's/\//_/g')" |
31 | | - pack package-buildpack --publish ${PACKAGE}:${VERSION} |
32 | | - DIGEST="$(crane digest ${PACKAGE}:${VERSION})" |
33 | | - echo "::set-output name=bp_id::$BP_ID" |
34 | | - echo "::set-output name=version::$VERSION" |
35 | | - echo "::set-output name=address::${PACKAGE}@${DIGEST}" |
36 | | - shell: bash |
37 | | - env: |
38 | | - REPO: ghcr.io/${{ github.repository_owner }}/buildpacks |
39 | | - - id: register |
40 | | - uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:4.1.0 |
41 | | - with: |
42 | | - token: ${{ secrets.PUBLIC_REPO_TOKEN }} |
43 | | - id: ${{ steps.package.outputs.bp_id }} |
44 | | - version: ${{ steps.package.outputs.version }} |
45 | | - address: ${{ steps.package.outputs.address }} |
| 7 | + register: |
| 8 | + name: Package, Publish, and Register |
| 9 | + runs-on: |
| 10 | + - ubuntu-latest |
| 11 | + steps: |
| 12 | + - id: checkout |
| 13 | + name: Checkout code |
| 14 | + uses: actions/checkout@v2 |
| 15 | + - if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} |
| 16 | + name: Login to GitHub Package Registry |
| 17 | + uses: docker/login-action@v1 |
| 18 | + with: |
| 19 | + registry: ghcr.io |
| 20 | + username: ${{ github.repository_owner }} |
| 21 | + password: ${{ secrets.GHCR_TOKEN }} |
| 22 | + - id: setup-pack |
| 23 | + uses: buildpacks/github-actions/setup-pack@v4.1.0 |
| 24 | + - id: package |
| 25 | + run: | |
| 26 | + #!/usr/bin/env bash |
| 27 | + set -euo pipefail |
| 28 | + BP_ID="$(cat buildpack.toml | yj -t | jq -r .buildpack.id)" |
| 29 | + VERSION="$(cat buildpack.toml | yj -t | jq -r .buildpack.version)" |
| 30 | + PACKAGE="${REPO}/$(echo "$BP_ID" | sed 's/\//_/g')" |
| 31 | + pack buildpack package --publish ${PACKAGE}:${VERSION} |
| 32 | + DIGEST="$(crane digest ${PACKAGE}:${VERSION})" |
| 33 | + echo "::set-output name=bp_id::$BP_ID" |
| 34 | + echo "::set-output name=version::$VERSION" |
| 35 | + echo "::set-output name=address::${PACKAGE}@${DIGEST}" |
| 36 | + shell: bash |
| 37 | + env: |
| 38 | + REPO: ghcr.io/${{ github.repository_owner }}/buildpacks |
| 39 | + - id: register |
| 40 | + uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:4.1.0 |
| 41 | + with: |
| 42 | + token: ${{ secrets.PUBLIC_REPO_TOKEN }} |
| 43 | + id: ${{ steps.package.outputs.bp_id }} |
| 44 | + version: ${{ steps.package.outputs.version }} |
| 45 | + address: ${{ steps.package.outputs.address }} |
0 commit comments