diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e9ee6fa17..faf8dcf3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,14 @@ on: jobs: build: - runs-on: ubuntu-latest + environment: Release + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-18.04] + node: + - 14 steps: - uses: actions/checkout@v2 @@ -19,20 +26,14 @@ jobs: # set up git since we will later push to the repo - run: git config --global user.name "GitHub CD bot" - run: git config --global user.email "npm@dfinity.org" - # upgrade npm version in package.json to the tag used in the release. - - run: npm version ${{ github.event.release.tag_name }} # build the project - - run: npm run build + - run: npm run build --workspaces # run tests just in case - run: npm test - - run: npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}" - # publish to NPM -> there is one caveat, continue reading for the fix - - run: npm run release --workspaces --if-present --tag ${{ github.event.release.target_commitish }} + - run: npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" env: # Use a token to publish to NPM. See below for how to set it up NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - # push the version changes to GitHub - - run: git push - env: - # The secret is passed automatically. Nothing to configure. - github-token: ${{ secrets.GITHUB_TOKEN }} + - run: npm whoami + # publish to NPM -> there is one caveat, continue reading for the fix + - run: npm publish --workspaces --access public