File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 88
99env :
1010 IMAGE_NAME : ${{ github.repository }}
11+ COMPONENT_NAME : rust-wasi-hello
1112
1213jobs :
1314 publish :
1415 runs-on : ubuntu-latest
16+ permissions :
17+ id-token : write
18+ packages : write
19+ contents : read
1520
1621 steps :
1722 - name : Checkout repository
2025 id : meta
2126 uses : docker/metadata-action@v5
2227 with :
23- images : ghcr.io/${{ github.actor }}/rust-wasi-hello
28+ images : ghcr.io/${{ github.actor }}/{{ env.COMPONENT_NAME }}
2429 tags : |
2530 type=semver,pattern={{version}}
2631 - name : Login to GitHub Container Registry
3035 username : ${{ github.actor }}
3136 password : ${{ secrets.GITHUB_TOKEN }}
3237
38+ - name : Install cosign
39+ uses : sigstore/cosign-installer@v3.7.0
40+
3341 - name : Cache cargo bin
3442 id : cache-cargo
3543 uses : actions/cache@v3
5159 - name : Run build script
5260 run : bash scripts/build.sh
5361
54- - name : Run publish script
55- run : bash scripts/publish.sh ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
62+ - name : Publish to GitHub Container Registry
63+ id : publish
64+ uses : bytecodealliance/wkg-github-action@v5
65+ with :
66+ file : target/wasm32-wasip1/release/${{ env.COMPONENT_NAME }}.wasm
67+ oci-reference-without-tag : ghcr.io/${{ env.IMAGE_NAME }}/${{ env.COMPONENT_NAME }}
68+ version : ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
69+
70+ - name : Sign the wasm component
71+ run : cosign sign --yes ghcr.io/${{ env.IMAGE_NAME }}/${{ env.COMPONENT_NAME}}@${{ steps.publish.outputs.digest }}
You can’t perform that action at this time.
0 commit comments