From bcb6f3a7cd1db9b9f651060cd9371deea63f0126 Mon Sep 17 00:00:00 2001 From: belopash Date: Thu, 11 Jul 2024 18:11:26 +0500 Subject: [PATCH] add prerelease workflow --- .github/workflows/prerelease.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/release.yml | 12 +++--------- common/config/rush/.npmrc-publish | 3 +-- 3 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/prerelease.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 000000000..878178b5e --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,29 @@ +name: prerelease +on: + workflow_dispatch: + +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: master + fetch-depth: 0 + + - name: Configure git user + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + + - name: Install dependencies + run: node common/scripts/install-run-rush.js install + + - name: Build project + run: node common/scripts/install-run-rush.js build + + - name: Publish npm packages + run: node common/scripts/install-run-rush.js publish --apply --version-policy npm --partial-prerelease --publish --tag beta --prerelease-name beta.${GITHUB_SHA::6} + env: + NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d65133db..30edcb5af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ jobs: name: release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: release/arrowsquid fetch-depth: 0 @@ -17,14 +17,6 @@ jobs: git config --global user.name 'github-actions' git config --global user.email 'github-actions@github.com' - - name: Write npm credentials - run: | - echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> common/config/rush/.npmrc - echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> common/config/rush/.npmrc-publish - cd common/config/rush && npm whoami - env: - NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - - name: Install dependencies run: node common/scripts/install-run-rush.js install @@ -33,3 +25,5 @@ jobs: - name: Publish npm packages run: node common/scripts/install-run-rush.js publish --include-all --version-policy npm --target-branch release/arrowsquid --publish --tag latest + env: + NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} \ No newline at end of file diff --git a/common/config/rush/.npmrc-publish b/common/config/rush/.npmrc-publish index 7cc1eafbd..e2ab024b8 100644 --- a/common/config/rush/.npmrc-publish +++ b/common/config/rush/.npmrc-publish @@ -19,5 +19,4 @@ always-auth=true registry=https://registry.npmjs.org/ -//localhost:4873/:_authToken=foo -# //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN} +//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}