Skip to content

Commit

Permalink
feat(mcc): update pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
lachieh committed Oct 23, 2023
1 parent 6a49928 commit 740b344
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 34 deletions.
42 changes: 15 additions & 27 deletions .github/workflows/release-multichannelchat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,25 @@ jobs:
- multi-channel-chat/nats-channel
include:
- working-directory: multi-channel-chat/api-gateway
artifact-name: api-gateway
artifact-name: mcc-api-gateway
wash-key: AWESOME_COSMONIC_MCC_APIGATEWAY_KEY
- working-directory: multi-channel-chat/chatlog
artifact-name: chatlog
artifact-name: mcc-chatlog
wash-key: AWESOME_COSMONIC_MCC_CHATLOG_KEY
- working-directory: multi-channel-chat/http-channel
artifact-name: http-channel
artifact-name: mcc-http-channel
wash-key: AWESOME_COSMONIC_MCC_HTTPCHANNEL_KEY
- working-directory: multi-channel-chat/nats-channel
artifact-name: nats-channel
artifact-name: mcc-nats-channel
wash-key: AWESOME_COSMONIC_MCC_NATSCHANNEL_KEY
steps:
- uses: actions/checkout@v3
- uses: wasmcloud/common-actions/install-wash@main
- name: Add wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown

- name: Set wash subject key (api-gateway)
if: ${{ matrix.artifact-name == 'api-gateway' }}
run: echo "WASH_SUBJECT_KEY=${{ secrets.AWESOME_COSMONIC_MCC_APIGATEWAY_KEY }}" > $GITHUB_ENV
- name: Set wash subject key (chatlog)
if: ${{ matrix.artifact-name == 'chatlog' }}
run: echo "WASH_SUBJECT_KEY=${{ secrets.AWESOME_COSMONIC_MCC_CHATLOG_KEY }}" > $GITHUB_ENV
- name: Set wash subject key (http-channel)
if: ${{ matrix.artifact-name == 'http-channel' }}
run: echo "WASH_SUBJECT_KEY=${{ secrets.AWESOME_COSMONIC_MCC_HTTPCHANNEL_KEY }}" > $GITHUB_ENV
- name: Set wash subject key (nats-channel)
if: ${{ matrix.artifact-name == 'nats-channel' }}
run: echo "WASH_SUBJECT_KEY=${{ secrets.AWESOME_COSMONIC_MCC_NATSCHANNEL_KEY }}" > $GITHUB_ENV
- name: Set wash subject key
run: echo "WASH_SUBJECT_KEY=${{ secrets[matrix.wash-key] }}" > $GITHUB_ENV

- name: Build and sign wasmCloud actor
env:
Expand Down Expand Up @@ -74,13 +68,13 @@ jobs:
- multi-channel-chat/nats-channel
include:
- working-directory: multi-channel-chat/api-gateway
artifact-name: api-gateway
artifact-name: mcc-api-gateway
- working-directory: multi-channel-chat/chatlog
artifact-name: chatlog
artifact-name: mcc-chatlog
- working-directory: multi-channel-chat/http-channel
artifact-name: http-channel
artifact-name: mcc-http-channel
- working-directory: multi-channel-chat/nats-channel
artifact-name: nats-channel
artifact-name: mcc-nats-channel
steps:
- uses: actions/checkout@v3
- uses: wasmcloud/common-actions/install-wash@main
Expand All @@ -94,20 +88,14 @@ jobs:
echo "actor-name=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].name')" >> $GITHUB_ENV
working-directory: ${{ matrix.working-directory }}
- 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: ${{ matrix.working-directory }}
- name: Determine actor version (main)
if: ${{ !startswith(github.ref, 'refs/tags/') }}
run: |
echo "actor-version=latest" >> $GITHUB_ENV
working-directory: ${{ matrix.working-directory }}
- name: Push actor to AzureCR
uses: wasmcloud/common-actions/oci-artifact-release@main
with:
artifact-path: ${{ matrix.working-directory }}/build/${{ env.actor-name }}_s.wasm
oci-url: ${{ secrets.AZURECR_PUSH_URL }}
oci-url: ${{ secrets.AZURECR_PUSH_URL }}
oci-repository: ${{ env.actor-name }}
oci-version: ${{ env.actor-version }}
oci-username: ${{ secrets.COSMONIC_AZURECR_PUSH_USER }}
Expand Down
4 changes: 2 additions & 2 deletions multi-channel-chat/api-gateway/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "apigateway"
name = "mcc-api-gateway"
version = "0.1.0"
authors = [ "Cosmonic Team" ]
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]
name = "apigateway"
name = "mcc-api-gateway"

[dependencies]
async-trait = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion multi-channel-chat/chatlog/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "chatlog"
name = "mcc-chatlog"
version = "0.1.0"
authors = [ "Cosmonic Team" ]
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions multi-channel-chat/http-channel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "httpchannel"
name = "mcc-http-channel"
version = "0.1.0"
authors = [ "Cosmonic Team" ]
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]
name = "httpchannel"
name = "mcc-http-channel"

[dependencies]
async-trait = "0.1"
Expand Down
1 change: 1 addition & 0 deletions multi-channel-chat/multi-channel-chat.wadm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# WIP
4 changes: 2 additions & 2 deletions multi-channel-chat/nats-channel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "natschannel"
name = "mcc-nats-channel"
version = "0.1.0"
authors = [ "Cosmonic Team" ]
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]
name = "natschannel"
name = "mcc-nats-channel"

[dependencies]
async-trait = "0.1"
Expand Down

0 comments on commit 740b344

Please sign in to comment.