|
1 | 1 | name: build |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - push: |
6 | | - branches: |
7 | | - - main |
8 | | - tags: |
9 | | - - "v*" |
10 | | - workflow_dispatch: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + tags: |
| 9 | + - "v*" |
| 10 | + workflow_dispatch: |
11 | 11 |
|
12 | 12 | permissions: |
13 | | - artifact-metadata: write |
14 | | - attestations: write |
15 | | - contents: read |
16 | | - packages: write |
17 | | - id-token: write |
| 13 | + artifact-metadata: write |
| 14 | + attestations: write |
| 15 | + contents: read |
| 16 | + packages: write |
| 17 | + id-token: write |
18 | 18 |
|
19 | 19 | env: |
20 | | - IMAGE_NAME: ghcr.io/getarcaneapp/tools |
21 | | - PUBLISH_PLATFORMS: linux/amd64,linux/386,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x |
| 20 | + IMAGE_NAME: ghcr.io/getarcaneapp/tools |
| 21 | + PUBLISH_PLATFORMS: linux/amd64,linux/386,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x |
22 | 22 |
|
23 | 23 | jobs: |
24 | | - validate: |
25 | | - runs-on: ubuntu-latest |
26 | | - steps: |
27 | | - - name: Check out repository |
28 | | - uses: actions/checkout@v6 |
| 24 | + validate: |
| 25 | + if: ${{ github.repository_owner != 'getarcaneapp' && github.actor != |
| 26 | + 'getarcaneappbot' }} |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - name: Check out repository |
| 30 | + uses: actions/checkout@v6 |
29 | 31 |
|
30 | | - - name: Set up Docker Buildx |
31 | | - uses: docker/setup-buildx-action@v4 |
| 32 | + - name: Set up Docker Buildx |
| 33 | + uses: docker/setup-buildx-action@v4 |
32 | 34 |
|
33 | | - - name: Build validation image |
34 | | - uses: docker/build-push-action@v7 |
35 | | - with: |
36 | | - context: . |
37 | | - load: true |
38 | | - platforms: linux/amd64 |
39 | | - tags: arcane-toolbox:ci |
| 35 | + - name: Build validation image |
| 36 | + uses: docker/build-push-action@v7 |
| 37 | + with: |
| 38 | + context: . |
| 39 | + load: true |
| 40 | + platforms: linux/amd64 |
| 41 | + tags: arcane-toolbox:ci |
40 | 42 |
|
41 | | - - name: Validate runtime contract |
42 | | - run: ./scripts/validate.sh arcane-toolbox:ci |
| 43 | + - name: Validate runtime contract |
| 44 | + run: ./scripts/validate.sh arcane-toolbox:ci |
43 | 45 |
|
44 | | - publish: |
45 | | - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') |
46 | | - needs: validate |
47 | | - runs-on: depot-ubuntu-latest |
48 | | - steps: |
49 | | - - name: Check out repository |
50 | | - uses: actions/checkout@v6 |
| 46 | + publish: |
| 47 | + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') |
| 48 | + needs: validate |
| 49 | + runs-on: depot-ubuntu-latest |
| 50 | + steps: |
| 51 | + - name: Check out repository |
| 52 | + uses: actions/checkout@v6 |
51 | 53 |
|
52 | | - - name: Set up Depot CLI |
53 | | - uses: depot/setup-action@v1 |
| 54 | + - name: Set up Depot CLI |
| 55 | + uses: depot/setup-action@v1 |
54 | 56 |
|
55 | | - - name: Log in to GHCR |
56 | | - uses: docker/login-action@v4 |
57 | | - with: |
58 | | - registry: ghcr.io |
59 | | - username: ${{ github.actor }} |
60 | | - password: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + - name: Log in to GHCR |
| 58 | + uses: docker/login-action@v4 |
| 59 | + with: |
| 60 | + registry: ghcr.io |
| 61 | + username: ${{ github.actor }} |
| 62 | + password: ${{ secrets.GITHUB_TOKEN }} |
61 | 63 |
|
62 | | - - name: Derive image metadata |
63 | | - id: meta |
64 | | - uses: docker/metadata-action@v6 |
65 | | - with: |
66 | | - images: ${{ env.IMAGE_NAME }} |
67 | | - tags: | |
68 | | - type=semver,pattern={{version}} |
69 | | - type=semver,pattern={{major}}.{{minor}} |
70 | | - type=semver,pattern={{major}} |
71 | | - type=sha |
| 64 | + - name: Derive image metadata |
| 65 | + id: meta |
| 66 | + uses: docker/metadata-action@v6 |
| 67 | + with: |
| 68 | + images: ${{ env.IMAGE_NAME }} |
| 69 | + tags: | |
| 70 | + type=semver,pattern={{version}} |
| 71 | + type=semver,pattern={{major}}.{{minor}} |
| 72 | + type=semver,pattern={{major}} |
| 73 | + type=sha |
72 | 74 |
|
73 | | - - name: Build and publish image |
74 | | - id: build |
75 | | - uses: depot/build-push-action@v1 |
76 | | - with: |
77 | | - project: np622krb2x |
78 | | - context: . |
79 | | - file: ./Dockerfile |
80 | | - platforms: ${{ env.PUBLISH_PLATFORMS }} |
81 | | - push: true |
82 | | - tags: ${{ steps.meta.outputs.tags }} |
83 | | - labels: ${{ steps.meta.outputs.labels }} |
| 75 | + - name: Build and publish image |
| 76 | + id: build |
| 77 | + uses: depot/build-push-action@v1 |
| 78 | + with: |
| 79 | + project: np622krb2x |
| 80 | + context: . |
| 81 | + file: ./Dockerfile |
| 82 | + platforms: ${{ env.PUBLISH_PLATFORMS }} |
| 83 | + push: true |
| 84 | + tags: ${{ steps.meta.outputs.tags }} |
| 85 | + labels: ${{ steps.meta.outputs.labels }} |
84 | 86 |
|
85 | | - - name: Generate image digest attestation |
86 | | - uses: actions/attest@v4 |
87 | | - with: |
88 | | - subject-name: ${{ env.IMAGE_NAME }} |
89 | | - subject-digest: ${{ steps.build.outputs.digest }} |
90 | | - push-to-registry: true |
| 87 | + - name: Generate image digest attestation |
| 88 | + uses: actions/attest@v4 |
| 89 | + with: |
| 90 | + subject-name: ${{ env.IMAGE_NAME }} |
| 91 | + subject-digest: ${{ steps.build.outputs.digest }} |
| 92 | + push-to-registry: true |
91 | 93 |
|
92 | | - - name: Record published digest |
93 | | - run: | |
94 | | - { |
95 | | - echo "Published image: ${{ env.IMAGE_NAME }}" |
96 | | - echo "Published platforms: ${{ env.PUBLISH_PLATFORMS }}" |
97 | | - echo "Published digest: ${{ steps.build.outputs.digest }}" |
98 | | - echo "Published attestation: ${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}" |
99 | | - } >> "$GITHUB_STEP_SUMMARY" |
| 94 | + - name: Record published digest |
| 95 | + run: | |
| 96 | + { |
| 97 | + echo "Published image: ${{ env.IMAGE_NAME }}" |
| 98 | + echo "Published platforms: ${{ env.PUBLISH_PLATFORMS }}" |
| 99 | + echo "Published digest: ${{ steps.build.outputs.digest }}" |
| 100 | + echo "Published attestation: ${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}" |
| 101 | + } >> "$GITHUB_STEP_SUMMARY" |
0 commit comments