@@ -2,7 +2,7 @@ name: pull-request
22on :
33 pull_request :
44 paths-ignore :
5- - ' **.md'
5+ - " **.md"
66
77 workflow_dispatch :
88
@@ -27,52 +27,53 @@ jobs:
2727 uses : ./.github/workflows/tests.yml
2828 secrets : inherit
2929
30- publish-pr :
31- runs-on : ubuntu-latest
32- needs : [pre-run, tests]
33- if : needs.pre-run.outputs.is-not-fork == 'true'
34- steps :
35- - uses : actions/checkout@v3
36- if : github.event_name == 'pull_request'
37- with :
38- ref : ${{ github.event.pull_request.head.ref }}
39- fetch-depth : 0
40- - uses : actions/checkout@v3
41- if : github.event_name == 'workflow_dispatch'
42- with :
43- fetch-depth : 0
44- - uses : actions/setup-node@v3
45- with :
46- node-version : 20
47- cache : npm
48- - run : npm install -g npm@latest && npm ci
49- - name : Set up npm auth token
50- run : echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
51- env :
52- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
53- - name : Publish to npm (feature branch)
54- id : publish-pr
55- run : |
56- PUBLISH_OUTPUT_FILE=$(mktemp)
57- npx lerna publish --canary --force-publish --preid pr --dist-tag pr --no-verify-access --no-push --no-git-tag-version --yes | tee $PUBLISH_OUTPUT_FILE
58- VERSION=$(grep -oP '@stacks/common\s*=>\s*\K[^\s]+' $PUBLISH_OUTPUT_FILE | head -n 1)
59- echo "Canary version: $VERSION"
60- echo "::set-output name=version::$VERSION"
61- if : ${{ (github.head_ref || github.ref_name) != 'nakamoto' && (github.head_ref || github.ref_name) != 'next' }}
62- env :
63- SKIP_TESTS : true
64- - name : Publish to npm (next/nakamoto)
65- run : |
66- git reset --hard
67- npx lerna publish --canary major --force-publish --preid $BRANCH --dist-tag $BRANCH --no-verify-access --no-push --no-git-tag-version --yes
68- if : ${{ (github.head_ref || github.ref_name) == 'nakamoto' || (github.head_ref || github.ref_name) == 'next' }}
69- env :
70- BRANCH : ${{ github.head_ref || github.ref_name }}
71- SKIP_TESTS : true
72- - name : Edit pull-request description with published version
73- uses : janniks/pull-request-fixed-header@v1.0.1
74- with :
75- header : " > This PR was published to npm with the version `${{ steps.publish-pr.outputs.version || env.BRANCH }}`\n > e.g. `npm install @stacks/common@${{ steps.publish-pr.outputs.version || env.BRANCH }} --save-exact`"
76- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
77- env :
78- BRANCH : ${{ github.head_ref || github.ref_name }}
30+ # FOR NOW DISABLE PUBLISHING TO NPM ON EACH PULL-REQUEST PUSH
31+ # publish-pr:
32+ # runs-on: ubuntu-latest
33+ # needs: [pre-run, tests]
34+ # if: needs.pre-run.outputs.is-not-fork == 'true'
35+ # steps:
36+ # - uses: actions/checkout@v3
37+ # if: github.event_name == 'pull_request'
38+ # with:
39+ # ref: ${{ github.event.pull_request.head.ref }}
40+ # fetch-depth: 0
41+ # - uses: actions/checkout@v3
42+ # if: github.event_name == 'workflow_dispatch'
43+ # with:
44+ # fetch-depth: 0
45+ # - uses: actions/setup-node@v3
46+ # with:
47+ # node-version: 20
48+ # cache: npm
49+ # - run: npm install -g npm@latest && npm ci
50+ # - name: Set up npm auth token
51+ # run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
52+ # env:
53+ # NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
54+ # - name: Publish to npm (feature branch)
55+ # id: publish-pr
56+ # run: |
57+ # PUBLISH_OUTPUT_FILE=$(mktemp)
58+ # npx lerna publish --canary --force-publish --preid pr --dist-tag pr --no-verify-access --no-push --no-git-tag-version --yes | tee $PUBLISH_OUTPUT_FILE
59+ # VERSION=$(grep -oP '@stacks/common\s*=>\s*\K[^\s]+' $PUBLISH_OUTPUT_FILE | head -n 1)
60+ # echo "Canary version: $VERSION"
61+ # echo "::set-output name=version::$VERSION"
62+ # if: ${{ (github.head_ref || github.ref_name) != 'nakamoto' && (github.head_ref || github.ref_name) != 'next' }}
63+ # env:
64+ # SKIP_TESTS: true
65+ # - name: Publish to npm (next/nakamoto)
66+ # run: |
67+ # git reset --hard
68+ # npx lerna publish --canary major --force-publish --preid $BRANCH --dist-tag $BRANCH --no-verify-access --no-push --no-git-tag-version --yes
69+ # if: ${{ (github.head_ref || github.ref_name) == 'nakamoto' || (github.head_ref || github.ref_name) == 'next' }}
70+ # env:
71+ # BRANCH: ${{ github.head_ref || github.ref_name }}
72+ # SKIP_TESTS: true
73+ # - name: Edit pull-request description with published version
74+ # uses: janniks/pull-request-fixed-header@v1.0.1
75+ # with:
76+ # header: "> This PR was published to npm with the version `${{ steps.publish-pr.outputs.version || env.BRANCH }}`\n> e.g. `npm install @stacks/common@${{ steps.publish-pr.outputs.version || env.BRANCH }} --save-exact`"
77+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+ # env:
79+ # BRANCH: ${{ github.head_ref || github.ref_name }}
0 commit comments