From 5524fbb2340bfb7e466e3214793a9a384fef47a5 Mon Sep 17 00:00:00 2001 From: Alec Gibson <12036746+alecgibson@users.noreply.github.com> Date: Fri, 31 May 2024 09:38:08 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=91=B7=E2=80=8D=E2=99=80?= =?UTF-8?q?=EF=B8=8F=20Automatically=20release=20package"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e7a21202b05cf59656cf5abc5fa68d312945eca. We release directly to npm, not to GH Packages, so we can't use our normal flow for this. --- .github/workflows/ci.yml | 26 -------------------------- deploy.sh | 14 +++++++++++++- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e5f073..9ec1b41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,29 +29,3 @@ jobs: run: npm run build - name: Test run: npm test - - release: - needs: - - build - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - timeout-minutes: 10 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20.x' - registry-url: 'https://npm.pkg.github.com' - - name: Install - # Skip post-install to avoid malicious scripts stealing PAT - run: npm install --ignore-script - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Post-install - run: npm rebuild && npm run prepare --if-present - - name: Build - run: npm run build - - name: Release - run: ./deploy.sh - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/deploy.sh b/deploy.sh index fc71262..17b67f0 100755 --- a/deploy.sh +++ b/deploy.sh @@ -5,7 +5,6 @@ VERSION="v$(node -p "require('./package.json').version")" git checkout main git pull git fetch --tags - VERSION_COUNT=$(git tag --list $VERSION | wc -l) if [ $VERSION_COUNT -gt 0 ] @@ -16,7 +15,20 @@ else echo "Deploying version $VERSION" fi +echo '!/dist' >> .gitignore + +npm install +npm test +npm run build + +git checkout -b release-$VERSION +git add .gitignore +git add --all dist/ +git commit --message "Release version $VERSION" git tag $VERSION git push origin refs/tags/$VERSION npm publish + +git checkout main +git branch --delete --force release-$VERSION