Skip to content

Commit

Permalink
ci: update semantic-release packages and related workflows (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu authored May 20, 2021
1 parent 164f289 commit 6f3a6ac
Show file tree
Hide file tree
Showing 5 changed files with 318 additions and 205 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/if-nodejs-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository (@latest tag -> master branch)
if: "!contains(github.event.release.tag_name, 'next')"
uses: actions/checkout@v2
with:
ref: master
- name: Checkout repository (@next tag -> next branch)
if: "contains(github.event.release.tag_name, 'next')"
uses: actions/checkout@v2
with:
ref: next
# target branch of release. More info https://docs.github.com/en/rest/reference/repos#releases
# in case release is created from release branch then we need to checkout from given branch
# if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working
ref: ${{ github.event.release.target_commitish }}
- name: Check if Node.js project and has package.json
id: packagejson
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/release-wc-and-playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ jobs:
name: Release Web-component
runs-on: ubuntu-latest
steps:
- name: Checkout repository (@latest tag -> master branch)
if: "!contains(github.event.release.tag_name, 'next')"
uses: actions/checkout@v2
with:
ref: master
- name: Checkout repository (@next tag -> next branch)
if: "contains(github.event.release.tag_name, 'next')"
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: next
# target branch of release. More info https://docs.github.com/en/rest/reference/repos#releases
# in case release is created from release branch then we need to checkout from given branch
# if @semantic-release/github is used to publish, the minimum version is 7.2.0 for proper working
ref: ${{ github.event.release.target_commitish }}
- name: Setup Node.js
uses: actions/setup-node@v1
with:
Expand All @@ -36,14 +33,14 @@ jobs:
# When adding "bump:version" script in package.json, make sure --allow-same-version is set in case someone forgot and updated package.json manually and we want to avoide this action to fail and raise confusion
run: VERSION=${{github.event.release.tag_name}} npm run bump:webcomp:version
- name: Release web-component to NPM (@latest tag)
if: "!contains(github.event.release.tag_name, 'next')"
if: github.event.release.target_commitish != 'next'
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./web-component/package.json
access: public
- name: Release web-component to NPM (@next tag)
if: "contains(github.event.release.tag_name, 'next')"
if: github.event.release.target_commitish == 'next'
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
Expand All @@ -53,7 +50,7 @@ jobs:

playground:
name: Release Playground
if: "!contains(github.event.release.tag_name, 'next')"
if: github.event.release.target_commitish != 'next'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
/**/dist
/library/browser
/library/styles
/library/LICENSE
/library/README.md

# misc
.DS_Store
Expand Down
Loading

0 comments on commit 6f3a6ac

Please sign in to comment.