|
58 | 58 | permissions:
|
59 | 59 | contents: read
|
60 | 60 | id-token: write
|
| 61 | + outputs: |
| 62 | + json: ${{ steps.nic_binaries.outputs.json }} |
61 | 63 | steps:
|
62 | 64 | - name: Checkout Repository
|
63 | 65 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
@@ -100,13 +102,94 @@ jobs:
|
100 | 102 | GORELEASER_CURRENT_TAG: "v${{ inputs.ic-version }}"
|
101 | 103 | if: ${{ inputs.force }}
|
102 | 104 |
|
| 105 | + - name: Extract NGINX Ingress Controller binary info |
| 106 | + id: nic_binaries |
| 107 | + run: | |
| 108 | + echo "json=$(.github/scripts/binary-json.sh ${{ github.workspace }}/dist ${{ github.event.repository.name }} "nginx-ingress")" >> $GITHUB_OUTPUT |
| 109 | + if: ${{ inputs.force }} |
| 110 | + |
103 | 111 | - name: Store Artifacts in Cache
|
104 | 112 | uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
105 | 113 | with:
|
106 | 114 | path: ${{ github.workspace }}/dist
|
107 | 115 | key: nginx-ingress-${{ inputs.go-md5 }}
|
108 | 116 | if: ${{ inputs.force }}
|
109 | 117 |
|
| 118 | + generate-assertion-doc: |
| 119 | + if: ${{ github.event_name != 'pull_request' }} |
| 120 | + name: Assertion Doc ${{ matrix.nic.arch }} |
| 121 | + needs: [binaries] |
| 122 | + runs-on: ${{ inputs.runner }} |
| 123 | + permissions: |
| 124 | + contents: read |
| 125 | + id-token: write # for compliance-rules action to sign assertion doc |
| 126 | + strategy: |
| 127 | + fail-fast: false |
| 128 | + matrix: |
| 129 | + nic: ${{ fromJSON( needs.binaries.outputs.json ) }} |
| 130 | + steps: |
| 131 | + - name: Checkout Repository |
| 132 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 133 | + with: |
| 134 | + ref: ${{ inputs.branch }} |
| 135 | + |
| 136 | + - name: Setup Golang Environment |
| 137 | + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 138 | + with: |
| 139 | + go-version-file: go.mod |
| 140 | + |
| 141 | + - name: Setup netrc |
| 142 | + run: | |
| 143 | + cat <<EOF > $HOME/.netrc |
| 144 | + machine azr.artifactory.f5net.com |
| 145 | + login ${{ secrets.ARTIFACTORY_USER }} |
| 146 | + password ${{ secrets.ARTIFACTORY_TOKEN }} |
| 147 | + EOF |
| 148 | + chmod 600 $HOME/.netrc |
| 149 | +
|
| 150 | + - name: Fetch Cached Artifacts |
| 151 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 152 | + with: |
| 153 | + path: ${{ github.workspace }}/dist |
| 154 | + key: nginx-ingress-${{ inputs.go-md5 }} |
| 155 | + fail-on-cache-miss: true |
| 156 | + |
| 157 | + - name: List packages in Go binary |
| 158 | + id: godeps |
| 159 | + env: |
| 160 | + GOPATH: ${{ inputs.go-path }} |
| 161 | + GOPROXY: ${{ inputs.go-proxy }} |
| 162 | + run: | |
| 163 | + go version -m ${{ matrix.nic.path }} > go_version_out_${{ github.run_id }}_${{ github.run_number }}.txt |
| 164 | + echo "go_version_out=$(find -type f -name "go_version_out*.txt" | head -n 1)" >> $GITHUB_OUTPUT |
| 165 | + echo "artifact_digest=$(openssl dgst -sha256 -r ${{ matrix.nic.path }} | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT |
| 166 | + cat $GITHUB_OUTPUT |
| 167 | +
|
| 168 | + - name: Generate Assertion Document |
| 169 | + id: assertiondoc |
| 170 | + uses: nginxinc/compliance-rules/.github/actions/assertion@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0 |
| 171 | + with: |
| 172 | + artifact-name: "${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_number }}_${{ matrix.nic.os }}_${{ matrix.nic.arch }}" |
| 173 | + artifact-digest: ${{ steps.godeps.outputs.artifact_digest }} |
| 174 | + build-type: "github.com" |
| 175 | + builder-id: "github" |
| 176 | + builder-version: v0.1.0 |
| 177 | + started-on: ${{ github.event.head_commit.timestamp || github.event.created_at }} |
| 178 | + finished-on: ${{ github.event.head_commit.timestamp || github.event.created_at }} |
| 179 | + invocation-id: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }} |
| 180 | + artifactory-user: ${{ secrets.ARTIFACTORY_USER }} |
| 181 | + artifactory-api-token: ${{ secrets.ARTIFACTORY_TOKEN }} |
| 182 | + artifactory-url: ${{ secrets.ARTIFACTORY_URL }} |
| 183 | + artifactory-repo: 'f5-nginx-go-local-approved-dependency' |
| 184 | + assertion-doc-file: assertion_${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_id }}_${{ github.run_number }}_${{ matrix.nic.os }}_${{ matrix.nic.arch }}.json |
| 185 | + build-content-path: ${{ steps.godeps.outputs.go_version_out }} |
| 186 | + |
| 187 | + - name: Sign and Store Assertion Document |
| 188 | + id: sign |
| 189 | + uses: nginxinc/compliance-rules/.github/actions/sign@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0 |
| 190 | + with: |
| 191 | + assertion-doc: ${{ steps.assertiondoc.outputs.assertion-document-path }} |
| 192 | + |
110 | 193 | build-docker:
|
111 | 194 | name: Build Docker OSS
|
112 | 195 | needs: [binaries]
|
|
0 commit comments