-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (75 loc) · 3.01 KB
/
release-kvcounter.yml
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
name: Release KVCounter to AzureCR
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "kvcounter/**"
tags:
- "v*"
env:
# For the release action, you'll have to set the following variables
WASH_ISSUER_KEY: ${{ secrets.COSMONIC_ACCOUNT_OFFICIAL }}
WASH_SUBJECT_KEY: ${{ secrets.AWESOME_COSMONIC_KVCOUNTER_KEY }}
working-directory: "./kvcounter"
jobs:
build_signed_actor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: wasmcloud/common-actions/install-wash@main
- name: Add wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown
working-directory: ${{ env.working-directory }}/rust
# Once you've written unit tests for your actor, you can uncomment
# the two lines below to automatically run tests
# - name: Test actor
# run: cargo test --target x86_64-unknown-linux-gnu -- --nocapture
- name: Build and sign wasmCloud actor
env:
WASH_ISSUER_KEY: ${{ env.WASH_ISSUER_KEY }}
WASH_SUBJECT_KEY: ${{ env.WASH_SUBJECT_KEY }}
run: |
wash new actor --path rust kvcounter
wash build -p kvcounter
shell: bash
working-directory: ${{ env.working-directory }}
- name: Upload signed actor to GH Actions
uses: actions/upload-artifact@v3
with:
name: wasmcloud-actor
path: ${{ env.working-directory }}/hello
artifact_release:
needs: build_signed_actor
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: wasmcloud/common-actions/install-wash@main
- name: Download signed actor
uses: actions/download-artifact@v3
with:
name: wasmcloud-actor
path: ${{ env.working-directory }}
- name: Determine actor name
run: |
echo "actor-name=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].name')" >> $GITHUB_ENV
working-directory: ${{ env.working-directory }}/kvcounter
- name: Determine actor version
if: startswith(github.ref, 'refs/tags/') # Only run on tag push
run: |
echo "actor-version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].version')" >> $GITHUB_ENV
working-directory: ${{ env.working-directory }}/kvcounter
- name: Determine actor version (main)
if: ${{ !startswith(github.ref, 'refs/tags/') }}
run: |
echo "actor-version=latest" >> $GITHUB_ENV
working-directory: ${{ env.working-directory }}/kvcounter
- name: Push actor to AzureCR
uses: wasmcloud/common-actions/oci-artifact-release@main
with:
artifact-path: ${{ env.working-directory }}/kvcounter/build/${{ env.actor-name }}_s.wasm
oci-url: ${{ secrets.AZURECR_PUSH_URL }}
oci-repository: ${{ env.actor-name }}
oci-version: ${{ env.actor-version }}
oci-username: ${{ secrets.COSMONIC_AZURECR_PUSH_USER }}
oci-password: ${{ secrets.COSMONIC_AZURECR_PUSH_PASSWORD }}