Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add remote workflow trigger binaries.yml #429

Merged
merged 4 commits into from
Jan 12, 2023

Conversation

joewagner
Copy link
Contributor

@joewagner joewagner commented Jan 3, 2023

Overview

This pr adds a job to the end of the binaries.yml workflow. The job is setup to wait until the building of the binaries is finished, then it will trigger a workflow in the js-validator repo.

Details

The workflow that is triggered in the js-validator repo does a few things:

  1. It creates a Pull Request to add binaries that were released here to the js-validator repo.
  2. In the PR it will also update the version of js-validator to match the go-tableland release.
  3. If the js-validator PR is merged, the binaries are automatically published to npm under a version matching the go-tableland release. Doing this will trigger dependabot enabled downstream consumers to be alerted to the new version.

See tablelandnetwork/js-validator#6 for all the details on what happens in js-validator.
One nuance to the separation of js-validator and this repository is that we can manually update the pull request with alternative builds like M1 ect... if someone on the team wants to experiment with a different arch + os.

cc: @brunocalza

@joewagner joewagner requested a review from asutula January 3, 2023 00:38
Copy link
Contributor Author

@joewagner joewagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be all ready to go, but we will have to merge tablelandnetwork/js-validator#6 before this workflow will be able to successfully trigger a pull request in js-validator

js-release:
runs-on: ubuntu-latest
if: ${{ success() }}
needs: [binaries]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using if + needs allows us to wait until all of the builds have succeeded before we trigger the js-validator workflow that will download them.

- name: PR to publish this release via the npm package
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TEXTILEIO_MACHINE_ACCESS_TOKEN }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to ensure that this secret is available.
cc: @asutula @carsonfarmer

// it and match standard symantics in the js ecosystem
let version = '${{ github.ref_name }}';
if (/^v[0-9]/.test(version)) {
version = version.slice(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check will ensure that if a release is named v1.0.0 or 1.0.0 the resulting version matches npm and semver, i.e. 1.0.0

@joewagner joewagner marked this pull request as ready for review January 5, 2023 00:56
@joewagner joewagner requested a review from carsonfarmer January 9, 2023 17:48
@joewagner
Copy link
Contributor Author

cc: @carsonfarmer this is the PR corresponding to tablelandnetwork/js-validator#6.
In order to test this I forked all the related repos with my personal account, created some pa tokens, and ran/triggered the the workflows to test that all the actions run correctly and work together. As mentioned elsewhere the textile machine token should enable us to run these workflows.

@joewagner joewagner merged commit 2f86848 into jsign/testnetmainnetsplit Jan 12, 2023
@joewagner joewagner deleted the joe/release-binaries branch January 12, 2023 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants