forked from deislabs/containerd-wasm-shims
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (79 loc) · 2.92 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.*"
jobs:
build:
uses: ./.github/workflows/build.yaml
build-and-push-wasm-images:
uses: ./.github/workflows/docker-build-push.yaml
with:
test: false
release:
permissions:
contents: write
packages: write
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set RELEASE_VERSION ENV var
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: lowercase the runner OS name
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
- name: copy release workload assets into _dist
run: |
mkdir -p _dist
cp ./deployments/workloads/runtime.yaml _dist/runtime.yaml
cp ./deployments/workloads/workload.yaml _dist/workload.yaml
- uses: actions/download-artifact@v3
with:
path: _artifacts
- name: create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ env.RELEASE_VERSION }} \
--generate-notes \
-p \
_dist/runtime.yaml#example-runtimes \
_dist/workload.yaml#example-workloads \
for f in ./_artifacts/*/*.tar.gz; do gh release upload ${{ env.RELEASE_VERSION }} $f; done
# Setup buildx to build multiarch image: https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: setup buildx
uses: docker/setup-buildx-action@v2
- name: login to GitHub container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push k3d shim image
- name: untar musl artifacts into ./deployments/k3d/.tmp/linux/(amd64|arm64) dir
run: |
mkdir -p ./deployments/k3d/.tmp/linux/amd64
mkdir -p ./deployments/k3d/.tmp/linux/arm64
for f in ./_artifacts/*/*-x86_64.tar.gz; do tar -xf $f --directory ./deployments/k3d/.tmp/linux/amd64; done
for f in ./_artifacts/*/*-aarch64.tar.gz; do tar -xf $f --directory ./deployments/k3d/.tmp/linux/arm64; done
- name: build and push k3d shim image
uses: docker/build-push-action@v5
with:
push: true
tags: |
ghcr.io/radu-matei/containerd-wasm-shims/examples/k3d:${{ env.RELEASE_VERSION }}
ghcr.io/radu-matei/containerd-wasm-shims/examples/k3d:latest
context: deployments/k3d
platforms: linux/amd64,linux/arm64
build-args: |
STAGE=release
- name: clear
if: always()
run: |
rm -f ${HOME}/.docker/config.json