From 60af0386c62ff819b5f5a06b8ebb2c10bc2e7251 Mon Sep 17 00:00:00 2001 From: mikebender Date: Wed, 28 Jul 2021 10:42:46 -0400 Subject: [PATCH 1/2] Update workflow_dispatch action to take a git SHA I _think_ should be able to trigger it off a PR then --- .github/workflows/publish-alpha.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index 19d95f8825..2633174664 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -1,5 +1,11 @@ name: Node.js Package Alpha -on: workflow_dispatch +on: + workflow_dispatch: + inputs: + ref: + description: 'Commit to deploy from. Defaults to branch used for workflow_dispatch action' + required: false + default: '' jobs: build: runs-on: ubuntu-latest @@ -8,6 +14,8 @@ jobs: packages: write steps: - uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.ref }} # Setup .npmrc file to publish to GitHub Packages - uses: actions/setup-node@v2 with: From c1d5d6a5117b321ae89e7ddc7e0529c999f95442 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Wed, 28 Jul 2021 15:05:21 -0400 Subject: [PATCH 2/2] Add a `preid` property to allow multiple concurrent active branches. See notes under https://github.com/lerna/lerna/tree/main/commands/publish#--canary --- .github/workflows/publish-alpha.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-alpha.yml b/.github/workflows/publish-alpha.yml index 2633174664..41b023688a 100644 --- a/.github/workflows/publish-alpha.yml +++ b/.github/workflows/publish-alpha.yml @@ -2,8 +2,12 @@ name: Node.js Package Alpha on: workflow_dispatch: inputs: + preid: + description: 'Preid used to publish package. Must be unique per branch.' + required: true + default: 'alpha' ref: - description: 'Commit to deploy from. Defaults to branch used for workflow_dispatch action' + description: 'Commit to deploy from. Defaults to branch used for workflow_dispatch action.' required: false default: '' jobs: @@ -23,6 +27,6 @@ jobs: registry-url: 'https://npm.pkg.github.com' - run: npm install - run: npm run build - - run: ./node_modules/.bin/lerna publish --canary --registry https://npm.pkg.github.com --yes + - run: ./node_modules/.bin/lerna publish --canary --preid ${{ github.event.inputs.preid }} --registry https://npm.pkg.github.com --yes env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}