fix: env var names #26
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish a Wasm Component to GitHub Artifacts | |
on: | |
push: | |
tags: | |
- v* | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
packages: write | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.actor }}/rust-wasi-hello | |
tags: | | |
type=semver,pattern={{version}} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install cosign | |
uses: sigstore/[email protected] | |
- name: Cache cargo bin | |
id: cache-cargo | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-cargo-bin | |
with: | |
path: ~/.cargo/bin | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('scripts/install.sh') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }} | |
name: Run install script | |
continue-on-error: false | |
run: bash scripts/install.sh | |
- name: Run build script | |
run: bash scripts/build.sh | |
# - name: Run publish script | |
# run: bash scripts/publish.sh ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} | |
# using my version until the PR is merged upstream | |
# https://github.com/bytecodealliance/wkg-github-action/pull/7 | |
- name: Publish to GitHub Container Registry | |
uses: duffney/wkg-github-action@9680cbd1dd38119bbc519c6c3e0b7fffe0b4982c | |
with: | |
file: target/wasm32-wasip1/release/rust_wasi_hello.wasm | |
oci-reference-without-tag: ghcr.io/${{ env.IMAGE_NAME }}/rust-wasi-hello | |
version: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} | |
- name: Sign the wasm component | |
run: cosign sign --yes ghcr.io/${{ env.IMAGE_NAME }}/rust-wasi-hello@${{ steps.publish.outputs.digest }} |