Skip to content

Commit

Permalink
patch(semantic-release): Add semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdovhan committed Feb 2, 2021
1 parent 053f143 commit 658b6f1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Test build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Build
run: |
npm install
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
name: Release
on:
release:
types: [published]
push:
branches:
- master
jobs:
release:
name: Prepare release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
# Build
- name: Build the file
run: |
cd /home/runner/work/purifier-card/purifier-card
npm install
npm run build
# Upload build file to the release as an asset
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/purifier-card/purifier-card/dist/purifier-card.js
asset_name: purifier-card.js
tag: ${{ github.ref }}
overwrite: true
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: Upload zip to release
# uses: svenstaro/upload-release-action@v1-release
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: /home/runner/work/purifier-card/purifier-card/dist/purifier-card.js
# asset_name: purifier-card.js
# tag: ${{ github.ref }}
# overwrite: true
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,24 @@
"lint-staged": {
"*.js": "eslint --fix",
"*": "prettier --write"
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/github",
{
"assets": [
{
"path": "dist/purifier-card.js",
"label": "A Purifier card bundle file"
}
]
}
],
"@semantic-release/changelog"
]
}
}

0 comments on commit 658b6f1

Please sign in to comment.