feat(*): update wadms to pull from ghcr #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Multi Channel Chat to GHCR | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
paths: | |
- "multi-channel-chat/**" | |
tags: | |
- "multi-channel-chat-v*" | |
env: | |
WASH_ISSUER_KEY: ${{ secrets.COSMONIC_ACCOUNT_OFFICIAL }} | |
jobs: | |
build_signed_actor: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
working-directory: | |
- multi-channel-chat/apigateway | |
- multi-channel-chat/chatlog | |
- multi-channel-chat/httpchannel | |
- multi-channel-chat/natschannel | |
include: | |
- working-directory: multi-channel-chat/apigateway | |
artifact-name: apigateway | |
wash-key: AWESOME_COSMONIC_MCC_APIGATEWAY_KEY | |
- working-directory: multi-channel-chat/chatlog | |
artifact-name: chatlog | |
wash-key: AWESOME_COSMONIC_MCC_CHATLOG_KEY | |
- working-directory: multi-channel-chat/httpchannel | |
artifact-name: httpchannel | |
wash-key: AWESOME_COSMONIC_MCC_HTTPCHANNEL_KEY | |
- working-directory: multi-channel-chat/natschannel | |
artifact-name: natschannel | |
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 | |
run: echo "WASH_SUBJECT_KEY=${{ secrets[matrix.wash-key] }}" > $GITHUB_ENV | |
- name: Build and sign wasmCloud actor | |
env: | |
WASH_ISSUER_KEY: ${{ env.WASH_ISSUER_KEY }} | |
WASH_SUBJECT_KEY: ${{ env.WASH_SUBJECT_KEY }} | |
run: wash build | |
shell: bash | |
working-directory: ${{ matrix.working-directory }} | |
- name: Upload signed actor to GH Actions | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: ${{ matrix.working-directory }}/build/*_s.wasm | |
artifact_release: | |
needs: build_signed_actor | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
working-directory: | |
- multi-channel-chat/apigateway | |
- multi-channel-chat/chatlog | |
- multi-channel-chat/httpchannel | |
- multi-channel-chat/natschannel | |
include: | |
- working-directory: multi-channel-chat/apigateway | |
artifact-name: apigateway | |
- working-directory: multi-channel-chat/chatlog | |
artifact-name: chatlog | |
- working-directory: multi-channel-chat/httpchannel | |
artifact-name: httpchannel | |
- working-directory: multi-channel-chat/natschannel | |
artifact-name: natschannel | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: wasmcloud/common-actions/install-wash@main | |
- name: Download signed actor | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: ${{ matrix.working-directory }}/build | |
- name: Determine actor name | |
run: | | |
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 | |
run: | | |
echo "actor-version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].version')" >> $GITHUB_ENV | |
working-directory: ${{ matrix.working-directory }} | |
- name: Push actor to GHCR | |
uses: wasmcloud/common-actions/oci-artifact-release@main | |
with: | |
artifact-path: ${{ matrix.working-directory }}/build/${{ env.actor-name }}_s.wasm | |
oci-url: ${{ secrets.GHCR_PUSH_URL }} | |
oci-repository: mcc_${{ env.actor-name }} | |
oci-version: ${{ env.actor-version }} | |
oci-username: ${{ github.actor }} | |
oci-password: ${{ secrets.GITHUB_TOKEN }} |