Skip to content

Commit

Permalink
ci(loader): add workflow dispatch to publish loader and refine CI steps
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Sep 4, 2023
1 parent a7024cf commit a5dfbb7
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 6 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/dev-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
# Releases are performed via a workflow dispatch
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
concurrency:
group: release
steps:

- name: ⬇️ Checkout repo
Expand All @@ -81,6 +83,21 @@ jobs:
with:
deno-version: 1.x

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: 👀 Env
run: |
echo "Event name: ${{ github.event_name }}"
echo "Git ref: ${{ github.ref }}"
echo "GH actor: ${{ github.actor }}"
echo "SHA: ${{ github.sha }}"
VER=`node --version`; echo "Node ver: $VER"
VER=`npm --version`; echo "npm ver: $VER"
VER=`deno --version`; echo "deno ver: $VER"
# The version in the manifest is used to set the version
# displayed for the CI. So we need to update version,
# prior to building the binaries
Expand Down Expand Up @@ -116,11 +133,6 @@ jobs:
fileName: wallet.json
encodedString: ${{ secrets.CI_WALLET }}

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Bundlr Client
run: |
npm i -g @bundlr-network/[email protected]
Expand Down
61 changes: 60 additions & 1 deletion .github/workflows/loader.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ✨ Test AO Wasm Loader
name: ✨ Test & Deploy AO Wasm Loader

on:
pull_request:
Expand All @@ -11,6 +11,13 @@ on:
- main
paths:
- "loader/**"

# Perform a release using a workflow dispatch
workflow_dispatch:
inputs:
version:
description: "semver version to bump to"
required: true

defaults:
run:
Expand All @@ -37,3 +44,55 @@ jobs:
yarn test
env:
CI: true

release:
# Releases are performed via a workflow dispatch
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
concurrency:
group: release
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"

- name: 👀 Env
run: |
echo "Event name: ${{ github.event_name }}"
echo "Git ref: ${{ github.ref }}"
echo "GH actor: ${{ github.actor }}"
echo "SHA: ${{ github.sha }}"
VER=`node --version`; echo "Node ver: $VER"
VER=`npm --version`; echo "npm ver: $VER"
- name: 🤓 Set Git User
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: ✊ Bump
id: bump
uses: hyper63/hyper-ci-bump@2
with:
bump-to: ${{ github.event.inputs.version }}
package: loader

- name: ⬆️ Push
run: |
git push
- name: 🦠 Publish to NPM
run: |
yarn
yarn build
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 5 additions & 0 deletions loader/.versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"skip": {
"tag": true
}
}

0 comments on commit a5dfbb7

Please sign in to comment.