From e4a91b77d0cee41b6e1c8200a4c5099e16584d5d Mon Sep 17 00:00:00 2001 From: ITOH Date: Sun, 20 Mar 2022 15:50:38 +0100 Subject: [PATCH] ci(workflows): fix publish to npm on version constant update (#2118) GitHub workflows cannot trigger another workflow. Due to this the npm workflow currently did not run on a version constant update. Since we will only publish with a version constant update there should be no problem when we move the npm release in there. Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> --- .github/workflows/npm.yml | 33 --------------------------------- .github/workflows/release.yml | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/npm.yml diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml deleted file mode 100644 index 49ff0260b..000000000 --- a/.github/workflows/npm.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: NPM Publish - -on: - create: - tags: - -jobs: - publish: - runs-on: ubuntu-latest - strategy: - matrix: - deno: ["v1.x"] - steps: - - uses: actions/checkout@v2 - - uses: denoland/setup-deno@main - with: - deno-version: ${{ matrix.deno }} - # Taken from: https://github.com/denoland/dnt#github-actions---npm-publish-on-tag - - name: Get tag version - if: startsWith(github.ref, 'refs/tags/') - id: get_tag_version - run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//} - - uses: actions/setup-node@v2 - with: - node-version: '16.x' - registry-url: 'https://registry.npmjs.org' - - name: npm build - run: deno run -A ./dnt.ts ${{steps.get_tag_version.outputs.TAG_VERSION}} - - name: npm publish - if: startsWith(github.ref, 'refs/tags/') - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: cd npm && npm publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 878c9de3d..ba63856b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - main jobs: - test: + publish: runs-on: ubuntu-latest strategy: matrix: @@ -24,4 +24,14 @@ jobs: - name: Create tag if: ${{ env.DISCORDENO_VERSION != env.DISCORDENO_VERSION_OLD }} run: git tag ${{ env.DISCORDENO_VERSION }} && git push --tags - + - uses: actions/setup-node@v2 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - name: build npm + run: deno run -A ./dnt.ts ${{ env.DISCORDENO_VERSION }} + - name: npm publish + if: ${{ env.DISCORDENO_VERSION != env.DISCORDENO_VERSION_OLD }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: cd npm && npm publish