Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit 99d1fcf

Browse files
Adds deploy pipelines for all components (#4)
1 parent 32017d2 commit 99d1fcf

File tree

4 files changed

+263
-7
lines changed

4 files changed

+263
-7
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Actor
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "service-applier/**"
8+
tags:
9+
- "kubernetes-service-applier-v*"
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
working-directory: ./service-applier
14+
WASH_ISSUER_KEY: ${{ secrets.COSMONIC_PUBLIC_ACCOUNT_OFFICIAL }}
15+
WASH_SUBJECT_KEY: ${{ secrets.COSMONIC_SERVICE_APPLIER }}
16+
17+
jobs:
18+
build_artifact:
19+
if: startswith(github.ref, 'refs/tags/') # Only run on tag push
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: wasmcloud/common-actions/install-wash@main
24+
- name: Install latest Rust stable toolchain
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: stable
28+
default: true
29+
components: clippy, rustfmt
30+
target: wasm32-unknown-unknown
31+
32+
- name: Build wasmcloud actor
33+
run: make
34+
working-directory: ${{ env.working-directory }}
35+
36+
- name: Upload signed actor to GH Actions
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: wasmcloud-actor
40+
path: ${{ env.working-directory }}/build/*.wasm
41+
42+
github_release:
43+
if: startswith(github.ref, 'refs/tags/') # Only run on tag push
44+
needs: build_artifact
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Download signed actor
48+
uses: actions/download-artifact@v2
49+
with:
50+
name: wasmcloud-actor
51+
path: ${{ env.working-directory }}/build
52+
53+
- name: Release
54+
uses: softprops/action-gh-release@v1
55+
with:
56+
files: ${{ env.working-directory }}/build/*.wasm
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
prerelease: true
59+
draft: false
60+
61+
artifact_release:
62+
needs: build_artifact
63+
if: startswith(github.ref, 'refs/tags/') # Only run on tag push
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v2
67+
- name: Download signed actor
68+
uses: actions/download-artifact@v2
69+
with:
70+
name: wasmcloud-actor
71+
path: ${{ env.working-directory }}/build
72+
73+
- name: Determine artifact metadata
74+
run: |
75+
echo "oci-repository=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].name')" >> $GITHUB_ENV
76+
echo "oci-version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].version')" >> $GITHUB_ENV
77+
working-directory: ${{ env.working-directory }}
78+
79+
- name: Push actor to AzureCR
80+
uses: wasmcloud/common-actions/oci-artifact-release@main
81+
with:
82+
artifact-path: ${{ env.working-directory }}/build/${{ env.oci-repository }}_s.wasm
83+
oci-url: ${{ secrets.AZURECR_PUSH_URL }}
84+
oci-repository: ${{ env.oci-repository }}
85+
oci-version: ${{ env.oci-version }}
86+
oci-username: ${{ secrets.AZURECR_PUSH_USER }}
87+
oci-password: ${{ secrets.AZURECR_PUSH_PASSWORD }}

.github/workflows/build.yaml

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ on:
88
env:
99
CARGO_TERM_COLOR: always
1010

11-
defaults:
12-
run:
13-
working-directory: applier
14-
1511
jobs:
16-
build:
12+
build-provider:
1713
runs-on: ${{ matrix.config.os }}
1814
strategy:
1915
fail-fast: false
@@ -32,8 +28,54 @@ jobs:
3228
default: true
3329
components: clippy, rustfmt
3430
- name: Build
31+
working-directory: applier
3532
run: make build
3633

34+
build-actor:
35+
runs-on: ${{ matrix.config.os }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
config:
40+
- { os: "ubuntu-latest" }
41+
- { os: "macos-latest" }
42+
- { os: "windows-latest" }
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
- name: Install latest Rust stable toolchain
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
toolchain: stable
50+
default: true
51+
components: clippy, rustfmt
52+
target: wasm32-unknown-unknown
53+
- name: Build
54+
working-directory: service-applier
55+
run: make release
56+
57+
build-interface:
58+
runs-on: ${{ matrix.config.os }}
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
config:
63+
- { os: "ubuntu-latest" }
64+
- { os: "macos-latest" }
65+
- { os: "windows-latest" }
66+
67+
steps:
68+
- uses: actions/checkout@v2
69+
- name: Install latest Rust stable toolchain
70+
uses: actions-rs/toolchain@v1
71+
with:
72+
toolchain: stable
73+
default: true
74+
components: clippy, rustfmt
75+
- name: Build
76+
working-directory: interface/rust
77+
run: cargo build
78+
3779
integration:
3880
runs-on: ubuntu-latest
3981

@@ -45,8 +87,6 @@ jobs:
4587
toolchain: stable
4688
default: true
4789
components: clippy, rustfmt
48-
- name: Build
49-
run: make build
5090
- uses: engineerd/[email protected]
5191
with:
5292
version: "v0.11.1"
@@ -55,4 +95,5 @@ jobs:
5595
run: |
5696
sed -i 's/127.0.0.1/localhost/g' ~/.kube/config
5797
- name: Run tests
98+
working-directory: applier
5899
run: make test
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Interface
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "interface/**"
8+
tags:
9+
- "kubernetes-applier-interface-v*"
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
working-directory: ./interface/rust
14+
15+
jobs:
16+
github_release:
17+
if: startswith(github.ref, 'refs/tags/') # Only run on tag push
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Create Release
21+
id: create_release
22+
uses: actions/create-release@v1
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
tag_name: ${{ github.ref }}
27+
release_name: Release ${{ github.ref }}
28+
draft: false
29+
prerelease: true
30+
31+
crates_release:
32+
if: startswith(github.ref, 'refs/tags/') # Only run on tag push
33+
needs: github_release
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v1
37+
- id: crates-release-action
38+
uses: wasmcloud/common-actions/crates-release@main
39+
with:
40+
working-directory: ${{ env.working-directory }}
41+
crates-token: ${{ secrets.CRATES_PUBLISH_TOKEN }}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Provider
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "applier/**"
8+
tags:
9+
- "kubernetes-applier-provider-v*"
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
working-directory: ./applier
14+
WASH_ISSUER_KEY: ${{ secrets.COSMONIC_PUBLIC_ACCOUNT_OFFICIAL }}
15+
WASH_SUBJECT_KEY: ${{ secrets.COSMONIC_KUBERNETES_APPLIER }}
16+
17+
jobs:
18+
build_artifact:
19+
if: startswith(github.ref, 'refs/tags/') # Only run on tag push
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: wasmcloud/common-actions/install-wash@main
24+
- uses: wasmcloud/common-actions/install-cross@main
25+
- name: Install latest Rust stable toolchain
26+
uses: actions-rs/toolchain@v1
27+
with:
28+
toolchain: stable
29+
default: true
30+
components: clippy, rustfmt
31+
32+
- name: Build full provider archive
33+
run: make par-full
34+
working-directory: ${{ env.working-directory }}
35+
36+
- name: Upload provider archive to GH Actions
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: provider-archive
40+
path: ${{ env.working-directory }}/build/*.par.gz
41+
42+
github_release:
43+
if: startswith(github.ref, 'refs/tags/') # Only run on tag push
44+
needs: build_artifact
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Download provider archive
48+
uses: actions/download-artifact@v2
49+
with:
50+
name: provider-archive
51+
path: ${{ env.working-directory }}/build
52+
53+
- name: Release
54+
uses: softprops/action-gh-release@v1
55+
with:
56+
files: ${{ env.working-directory }}/build/*.par.gz
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
prerelease: true
59+
draft: false
60+
61+
artifact_release:
62+
needs: build_artifact
63+
if: startswith(github.ref, 'refs/tags/') # Only run on tag push
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v2
67+
- name: Download provider archive
68+
uses: actions/download-artifact@v2
69+
with:
70+
name: provider-archive
71+
path: ${{ env.working-directory }}/build
72+
73+
- name: Determine artifact metadata
74+
run: |
75+
echo "oci-repository=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].name')" >> $GITHUB_ENV
76+
echo "oci-version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].version')" >> $GITHUB_ENV
77+
working-directory: ${{ env.working-directory }}
78+
79+
- name: Push provider archive to AzureCR
80+
uses: wasmcloud/common-actions/oci-artifact-release@main
81+
with:
82+
artifact-path: ${{ env.working-directory }}/build/${{ env.oci-repository }}.par.gz
83+
oci-url: ${{ secrets.AZURECR_PUSH_URL }}
84+
oci-repository: ${{ env.oci-repository }}
85+
oci-version: ${{ env.oci-version }}
86+
oci-username: ${{ secrets.AZURECR_PUSH_USER }}
87+
oci-password: ${{ secrets.AZURECR_PUSH_PASSWORD }}

0 commit comments

Comments
 (0)