forked from aheckmann/gm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
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 | ||
- name: Post-install | ||
run: npm rebuild && npm run prepare --if-present | ||
- name: Publish | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
VERSION=$(node -p "require('./package.json').version") | ||
|
||
git config --local user.email "github@reedsy.com" | ||
git config --local user.name "GitHub Action" | ||
git fetch --tags | ||
|
||
VERSION_COUNT=$(git tag --list $VERSION | wc -l) | ||
|
||
if [ $VERSION_COUNT -gt 0 ] | ||
then | ||
echo "Version $VERSION already deployed." | ||
exit 0 | ||
else | ||
echo "Deploying version $VERSION" | ||
fi | ||
|
||
echo '!/lib' >> .gitignore | ||
|
||
git checkout -b release-$VERSION | ||
git add .gitignore | ||
git add --all lib/ | ||
git commit --message "Release version $VERSION" | ||
git tag $VERSION | ||
git push origin refs/tags/$VERSION |