Skip to content

Commit

Permalink
refactor(workflows): extract wasi-demo-app release job to a dedicated…
Browse files Browse the repository at this point in the history
… workflow

Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>
  • Loading branch information
Mossaka committed Dec 16, 2024
1 parent 6c4bd76 commit 085bcb4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 25 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/relaese-wasi-demo-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json

name: Release
run-name: wasi-demo-app@${{ inputs.version }}

on:
workflow_dispatch:
inputs:
version:
description: "The version of the crate to release. (e.g., 1.2.3)"
type: string
required: true

env:
CARGO_TERM_COLOR: always

jobs:
release-wasi-demo-app:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup build env
run: ./scripts/setup-linux.sh
- name: Install Rust and wasm32-wasi target
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-wasi
override: true
- name: Build oci tarballs
run: |
sudo make test-image
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
25 changes: 0 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,28 +160,3 @@ jobs:
GH_TOKEN: ${{ github.token }}
RELEASE_NAME: ${{ matrix.crate }}/v${{ matrix.version }}

release-wasi-demo-app:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup build env
run: ./scripts/setup-linux.sh
- name: Install Rust and wasm32-wasi target
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-wasi
override: true
- name: Build oci tarballs
run: |
sudo make test-image
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

0 comments on commit 085bcb4

Please sign in to comment.