forked from OP-Engineering/link-preview-js
-
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.
feat: add ship.js for automated releases ⛴️
Signed-off-by: Vinayak Kulkarni <[email protected]>
- Loading branch information
Vinayak Kulkarni
committed
Apr 29, 2024
1 parent
57125ae
commit e797f3c
Showing
4 changed files
with
54 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Token required for automated releases using ship.js | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Ship js trigger | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v') | ||
steps: | ||
- name: Checkout code 🛎 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- name: Setup GitHub Actor | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Action" | ||
- name: Setup node environment 📦 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
check-latest: true | ||
cache: 'npm' | ||
registry-url: https://npm.pkg.github.com/ | ||
scope: '@dscvr-one' | ||
|
||
- name: Install dependencies 🚀 | ||
run: npm ci --prefer-offline --no-audit | ||
|
||
- name: Trigger a release 🥳 | ||
run: npx shipjs trigger | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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,3 @@ | ||
module.exports = { | ||
installCommand: () => 'npm i --prefer-offline --no-audit', | ||
}; |