Skip to content

Commit

Permalink
Merge pull request #429 from tablelandnetwork/joe/release-binaries
Browse files Browse the repository at this point in the history
add remote workflow trigger binaries.yml
  • Loading branch information
joewagner authored Jan 12, 2023
2 parents bb488ac + 7219027 commit 2f86848
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,49 @@ jobs:
push: true
tags: textile/tableland:latest,textile/tableland:${{ github.ref_name }}
platforms: linux/amd64, linux/arm64
js-release:
runs-on: ubuntu-latest
if: ${{ success() }}
needs: [binaries]
steps:
- run: echo "release_version ${{ github.ref_name }}"

- name: PR to publish this release via the npm package
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TEXTILEIO_MACHINE_ACCESS_TOKEN }}
script: |
// This triggers the release-pr workflow in the js-validator repo
// which will create a pull request in that repo to update the binaries
// on npm with this release
try {
const ownerOrg = 'tablelandnetwork';
// if the tag/release has a preceeding "v" we want to remove
// it and match standard symantics in the js ecosystem
let version = '${{ github.ref_name }}';
if (/^v[0-9]/.test(version)) {
version = version.slice(1);
}
const options = {
owner: ownerOrg,
repo: 'js-validator',
workflow_id: 'release-pr.yml',
ref: 'main',
inputs: {
release_version: version
}
};
console.log(options);
const response = await github.rest.actions.createWorkflowDispatch(options);
if (response.status !== 204) {
core.setFailed(`create workflow_dispatch received status code ${response.status}`);
}
} catch(err) {
console.log(err);
core.setFailed(err.message);
}

0 comments on commit 2f86848

Please sign in to comment.