Skip to content

Commit

Permalink
Revert "👷‍♀️ Automatically release package"
Browse files Browse the repository at this point in the history
This reverts commit 7e7a212.

We release directly to npm, not to GH Packages, so we can't use our
normal flow for this.
  • Loading branch information
alecgibson committed May 31, 2024
1 parent 7e7a212 commit 5524fbb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
14 changes: 13 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -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

0 comments on commit 5524fbb

Please sign in to comment.