Skip to content

Commit

Permalink
feat(workflows): add dry-run option for wasi-demo-app release workflo…
Browse files Browse the repository at this point in the history
…w and use ctr

Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>
  • Loading branch information
Mossaka committed Dec 16, 2024
1 parent 085bcb4 commit 2580f50
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/relaese-wasi-demo-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
description: "The version of the crate to release. (e.g., 1.2.3)"
type: string
required: true
dry_run:
description: "Run the release without actually releasing bits"
type: boolean
default: true

env:
CARGO_TERM_COLOR: always
Expand All @@ -35,8 +39,15 @@ jobs:
sudo make test-image/oci
ls -l dist/
- run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- uses: oras-project/setup-oras@v1
- run: |
oras push ghcr.io/containerd/wasi-demo-app:v${{ inputs.version }} dist/img.tar
oras push ghcr.io/containerd/wasi-demo-app-oci:v${{ inputs.version }} dist/img-oci.tar
oras push ghcr.io/containerd/wasi-demo-app-oci-artifact:v${{ inputs.version }} dist/img-oci-artifact.tar
- name: Load tarballs to ctr
run: |
sudo ctr image import dist/img.tar
sudo ctr image import dist/img-oci.tar
sudo ctr image import dist/img-oci-artifact.tar
- name: Push images to ghcr.io
if: ${{ inputs.dry_run == false }}
run: |
sudo ctr images push --user ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/${{ github.repository }}/wasi-demo-app:${{ inputs.version }}
sudo ctr images push --user ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/${{ github.repository }}/wasi-demo-oci:${{ inputs.version }}
sudo ctr images push --user ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/${{ github.repository }}/wasi-demo-oci-artifact:${{ inputs.version }}

0 comments on commit 2580f50

Please sign in to comment.