From 66db3ca0a1ec0d6c5afbfb6471b01f13370916bf Mon Sep 17 00:00:00 2001 From: Ricardo Ferrolho Date: Wed, 29 May 2024 17:50:00 +0100 Subject: [PATCH] Update CI --- .github/workflows/publish.yml | 36 ---------------------------------- .github/workflows/test.yml | 7 +++++-- scripts/{tag.sh => release.sh} | 2 ++ 3 files changed, 7 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/publish.yml rename scripts/{tag.sh => release.sh} (97%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 33d8450e..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish - -on: - push: - tags: - - '*' - branches-ignore: - - next - -jobs: - build: - runs-on: ubuntu-22.04 - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: '20.x' - always-auth: true - registry-url: "https://npm.pkg.github.com" - scope: "@reedsy" - - name: Install - # Skip post-install to avoid malicious scripts stealing PAT - run: npm install --ignore-script - env: - # GITHUB_TOKEN can't access packages hosted in private repos, - # even within the same organisation - NODE_AUTH_TOKEN: ${{ secrets.REEDSY_BOT_PERSONAL_ACCESS_TOKEN }} - - name: Post-install - run: npm rebuild && npm run prepare --if-present - - name: Publish - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6bb09a86..9046aaf0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,10 @@ on: jobs: build: runs-on: ubuntu-22.04 + if: ${{ github.actor != 'dependabot[bot]' }} + timeout-minutes: 10 + steps: - name: Checkout uses: actions/checkout@v4 @@ -33,6 +36,6 @@ jobs: run: npm rebuild && npm run prepare --if-present - name: Test run: npm test - - name: Tag + - name: Release if: ${{ github.ref == 'refs/heads/main' }} - run: ./scripts/tag.sh + run: ./scripts/release.sh diff --git a/scripts/tag.sh b/scripts/release.sh similarity index 97% rename from scripts/tag.sh rename to scripts/release.sh index 669c780f..fa2cd1f3 100755 --- a/scripts/tag.sh +++ b/scripts/release.sh @@ -24,3 +24,5 @@ git add --all lib/ git commit --message "Release version $VERSION" git tag $VERSION git push origin refs/tags/$VERSION + +npm publish