From ab137dce748564269e19fcdccf54d7f26d5fa179 Mon Sep 17 00:00:00 2001 From: James Forbes Date: Tue, 2 Nov 2021 09:03:39 +1100 Subject: [PATCH] Publish a pre-release on every push to next (#203) --- .github/workflows/merge.yml | 13 +++++++------ .github/workflows/pr.yml | 9 ++++++--- README.md | 2 +- templates/merge.yml | 13 +++++++------ templates/pr.yml | 9 ++++++--- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index bd786fa..51711b4 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -32,9 +32,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc - name: Setup NPM Auth - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: npm publish - name: Publish + # The following will publish the release to npm + - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc # prr:comment + name: Setup NPM Auth # prr:comment + env: # prr:comment + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # prr:comment + - run: npm publish # prr:comment + name: Publish # prr:comment diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d48dc21..8244a85 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -29,6 +29,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - - run: npm version --no-verify --no-commit-hooks --no-git-tag-version $(node bin.js infer-version) - - run: npm version --no-verify --no-commit-hooks --no-git-tag-version prerelease --preid=next - - run: cat package.json + # The following publishes a pre-release version every time `next` is updated + - run: npm version --no-verify --no-commit-hooks --no-git-tag-version $(node bin.js infer-version) # prr:comment + - run: npm version --no-verify --no-commit-hooks --no-git-tag-version prerelease --preid=next # prr:comment + - run: npm publish --tag=next # prr:comment + env: # prr:comment + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # prr:comment \ No newline at end of file diff --git a/README.md b/README.md index 437461b..b238d29 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ npx pr-release pr --source v2-next --target v2 ``` pr-release -version: 0.12.0 +version: 0.13.1 pr-release subcommand --options diff --git a/templates/merge.yml b/templates/merge.yml index ddb591e..ee16f66 100644 --- a/templates/merge.yml +++ b/templates/merge.yml @@ -32,9 +32,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc - name: Setup NPM Auth - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: npm publish - name: Publish + # The following will publish the release to npm + - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc # prr:comment + name: Setup NPM Auth # prr:comment + env: # prr:comment + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # prr:comment + - run: npm publish # prr:comment + name: Publish # prr:comment diff --git a/templates/pr.yml b/templates/pr.yml index 3455f69..402b53f 100644 --- a/templates/pr.yml +++ b/templates/pr.yml @@ -29,6 +29,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - - run: npm version --no-verify --no-commit-hooks --no-git-tag-version $(npx pr-release infer-version) - - run: npm version --no-verify --no-commit-hooks --no-git-tag-version prerelease --preid=$source - - run: cat package.json + # The following publishes a pre-release version every time `$source` is updated + - run: npm version --no-verify --no-commit-hooks --no-git-tag-version $(npx pr-release infer-version) # prr:comment + - run: npm version --no-verify --no-commit-hooks --no-git-tag-version prerelease --preid=$source # prr:comment + - run: npm publish --tag=$source # prr:comment + env: # prr:comment + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # prr:comment \ No newline at end of file