Skip to content

Commit

Permalink
chore: add automatic releases
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Aug 20, 2022
1 parent c3a7b5f commit c89e86d
Show file tree
Hide file tree
Showing 4 changed files with 933 additions and 9 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ jobs:

- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_RELEASE_TOKEN }}

- name: Setup Git
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "[email protected]"
- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand All @@ -30,3 +38,10 @@ jobs:

- name: Build the library
run: yarn build

- name: Publish
if: github.ref == 'refs/heads/main'
run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
3 changes: 3 additions & 0 deletions ossjs.release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
script: 'yarn publish --new-version $RELEASE_VERSION',
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"test": "jest",
"clean": "rimraf ./lib",
"build": "yarn clean && tsc",
"prepublishOnly": "yarn test && yarn build"
"prepublishOnly": "yarn test && yarn build",
"release": "release publish"
},
"files": [
"lib"
Expand All @@ -22,6 +23,7 @@
"positional"
],
"devDependencies": {
"@ossjs/release": "^0.3.2",
"@types/jest": "^26.0.23",
"jest": "^27.0.6",
"rimraf": "^3.0.2",
Expand Down
Loading

0 comments on commit c89e86d

Please sign in to comment.