-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 2.55 KB
/
build-package.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
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build and Push Azure Client Package
on:
push:
branches:
- main
tags:
- "v*"
paths:
- 'main.go'
- 'go.mod'
- 'go.sum'
- 'spin.toml'
- 'azure/**'
- '.github/workflows/**'
pull_request:
branches:
- main
jobs:
test-on-pull-request:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install go
uses: actions/setup-go@v3
with:
go-version: "1.22"
- name: run unit tests
run: make test
build-on-push:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install spin
uses: fermyon/actions/spin/setup@v1
with:
github_token: ${{ github.token }}
- name: install go
uses: actions/setup-go@v3
with:
go-version: "1.22"
- name: install tinygo
uses: rajatjindal/setup-actions/tinygo@v0.0.1
with:
version: "v0.32.0"
- name: run unit tests
run: make test
- name: cofiguring rust toolchain version
run: rustup toolchain install stable --profile minimal
- name: cache cargo registry and git index
id: cache-cargo-registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('install-script.sh') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: cache cargo binaries
id: cache-cargo-bin
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('install-script.sh') }}
restore-keys: |
${{ runner.os }}-cargo-bin-
- name: install wkg
run: cargo install --git https://github.com/bytecodealliance/wasm-pkg-tools wkg --locked --config net.git-fetch-with-cli=true --force
if: steps.cache-cargo-bin.outputs.cache-hit != 'true'
- name: build spinapp
run: spin build
- name: login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push package
run: RELEASE_VERSION=$(yq '.application.version' spin.toml) && wkg oci push ghcr.io/fermyon/wasm-pkg/fermyon-experimental/azure-client:$RELEASE_VERSION main.wasm