From 3bdb9235e0a5faf702be24ae3cc40fe7015271bf Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Wed, 31 May 2023 09:18:46 -0400 Subject: [PATCH] add release --- .github/workflows/ci.yml | 19 +------------------ .github/workflows/release.yml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40232ac..14b798c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,5 @@ name: CI - on: push - -permissions: - contents: write - jobs: build: runs-on: ubuntu-latest @@ -16,16 +11,4 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build --if-present - - run: npm test --if-present - - - name: Release - if: startsWith(github.ref, 'refs/tags/') - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - uses: softprops/action-gh-release@v1 - with: - files: | - *-x64 - *-arm64 - *-x64.exe \ No newline at end of file + - run: npm test --if-present \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8ae8af5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,18 @@ +name: Release +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file