Skip to content

Publish ic-websocket-cdk-mo #16

Publish ic-websocket-cdk-mo

Publish ic-websocket-cdk-mo #16

Workflow file for this run

name: Release ic-websocket-cdk-mo
# only run when the tests complete
on:
workflow_run:
workflows: [ic-websocket-cdk-mo tests]
types:
- completed
branches:
- main
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
# only run if the tests were successful
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
outputs:
version: ${{ steps.npm-publish.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: dfinity/setup-dfx@main
with:
dfx-version: 0.16.1
- name: install mops
run: npm i ic-mops -g
- name: install moc
run: npx mocv use latest
- name: publish on mops
run: |
mops import-identity --no-encrypt -- "${DFX_IDENTITY_PEM}"
mops publish
echo "version=$(cat mops.toml | grep "version =" | cut -d\" -f2)" >> "$GITHUB_OUTPUT"
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
DFX_IDENTITY_PEM: ${{ secrets.DFX_IDENTITY_PEM }}
tag:
needs: publish
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag_version.outputs.new_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ needs.publish.outputs.version }}
release:
needs: tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.tag.outputs.version }}