File: validate-release.yml

package info (click to toggle)
cosign 2.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,184 kB
  • sloc: sh: 229; makefile: 170
file content (97 lines) | stat: -rw-r--r-- 3,733 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#
# Copyright 2021 The Sigstore Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: CI-Validate-Release-Job

on:
  push:
    branches:
      - main
      - release-*
  pull_request:

jobs:
  check-signature:
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/sigstore/cosign/cosign:v3.0.3-dev@sha256:20826fbd1b274662771989eb847134019ac37d6985c7c78f51517532d723c8db

    steps:
      - name: Check Signature
        run: |
          cosign verify ghcr.io/gythialy/golang-cross:v1.25.5-0@sha256:3a7d463d9e3438513b6bd597c79f7d5db756023e04718259cc25aabd5d00fc17 \
          --certificate-oidc-issuer https://token.actions.githubusercontent.com \
          --certificate-identity "https://github.com/gythialy/golang-cross/.github/workflows/release-golang-cross.yml@refs/tags/v1.25.5-0"
        env:
          TUF_ROOT: /tmp

  validate-release-job:
    runs-on: ubuntu-latest
    needs:
      - check-signature

    container:
      image: ghcr.io/gythialy/golang-cross:v1.25.5-0@sha256:3a7d463d9e3438513b6bd597c79f7d5db756023e04718259cc25aabd5d00fc17
      volumes:
        - /usr:/host_usr
        - /opt:/host_opt

    permissions: {}

    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          persist-credentials: false

      # Error: fatal: detected dubious ownership in repository at '/__w/cosign/cosign'
      #      To add an exception for this directory, call:
      #          git config --system --add safe.directory /__w/cosign/cosign
      # Reason: Recent versions of git require the .git folder to be owned
      # by the same user (see https://github.blog/2022-04-12-git-security-vulnerability-announced/).
      # Related
      # - https://github.com/actions/runner/issues/2033
      # - https://github.com/actions/checkout/issues/1048
      # - https://github.com/actions/runner-images/issues/6775
      - run: git config --system --add safe.directory /__w/cosign/cosign

      # Related to https://github.com/sigstore/cosign/issues/3149
      # note this runs from within the golang-cross container, so if we want to free up space
      # on the host, we have to reach through the bind mounts to clean up unused content on the runners
      - name: free up disk space for the release
        run: |
          rm -rf /host_usr/share/dotnet || true
          rm -rf /host_usr/share/swift || true
          rm -rf /host_usr/local/lib/android || true
          rm -rf /host_usr/local/.ghcup || true
          rm -rf /host_usr/local/graalvm/ || true
          rm -rf /host_usr/local/share/powershell || true
          rm -rf /host_usr/local/share/chromium || true
          rm -rf /host_usr/local/lib/node_modules || true
          rm -rf /host_usr/lib/google-cloud-sdk || true
          rm -rf /host_usr/local/share/boost || true
          rm -rf /host_opt/hostedtoolcache/ || true
          rm -rf /host_opt/ghc || true
      - name: check disk space
        run: df -h

      - name: goreleaser snapshot
        run: make snapshot
        env:
          PROJECT_ID: honk-fake-project
          RUNTIME_IMAGE: gcr.io/distroless/static-debian12:nonroot

      - name: check binaries
        run: |
          ./dist/cosign-linux-amd64 version