|
| 1 | +# |
| 2 | +# Copyright 2023 The Sigstore Authors. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +name: CI-Container-Build |
| 17 | + |
| 18 | +on: |
| 19 | + workflow_dispatch: |
| 20 | + push: |
| 21 | + branches: |
| 22 | + - main |
| 23 | + |
| 24 | +jobs: |
| 25 | + build: |
| 26 | + name: build |
| 27 | + runs-on: ubuntu-latest |
| 28 | + |
| 29 | + permissions: |
| 30 | + id-token: write |
| 31 | + contents: read |
| 32 | + |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 |
| 35 | + - uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 # v3.1.1 |
| 36 | + |
| 37 | + - name: Extract version of Go to use |
| 38 | + run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV |
| 39 | + |
| 40 | + - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 |
| 41 | + with: |
| 42 | + go-version: ${{ env.GOVERSION }} |
| 43 | + |
| 44 | + - name: deps |
| 45 | + run: sudo apt-get update && sudo apt-get install -yq libpcsclite-dev |
| 46 | + |
| 47 | + - uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6 |
| 48 | + |
| 49 | + - name: Set up Cloud SDK |
| 50 | + uses: google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033 # v1.1.1 |
| 51 | + with: |
| 52 | + workload_identity_provider: 'projects/498091336538/locations/global/workloadIdentityPools/githubactions/providers/sigstore-fulcio' |
| 53 | + service_account: 'github-actions-fulcio@projectsigstore.iam.gserviceaccount.com' |
| 54 | + |
| 55 | + - name: creds |
| 56 | + run: gcloud auth configure-docker --quiet |
| 57 | + |
| 58 | + - name: container |
| 59 | + run: KO_PREFIX=gcr.io/projectsigstore/fulcio/ci/fulcio make sign-keyless-ci |
0 commit comments