Skip to content

Commit

Permalink
feat: release workflow (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos authored Aug 2, 2022
1 parent 9ebb328 commit 6fffa74
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v2
with:
node-version: ${{matrix.node}}
- run: npm install
- run: npm run build
- uses: bahmutov/npm-install@v1
- run: npm run build
- name: Lint
run: npm run lint
test-node:
Expand All @@ -29,17 +29,50 @@ jobs:
node: [14, 16]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v2
with:
node-version: ${{matrix.node}}
- run: npm install
- uses: bahmutov/npm-install@v1
- name: Unit tests
run: npm run test:node
test-browser:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- uses: bahmutov/npm-install@v1
- name: Unit tests
run: npm run test:browser
changelog:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Changelog
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.tag-release.outputs.releases_created }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: tag-release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changelog.outputs.releases_created
name: Release
runs-on: ubuntu-latest
needs:
- check
- test-node
- test-browser
- changelog
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org/
node-version: 16
- uses: bahmutov/npm-install@v1
- run: npm run build
- name: NPM Publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm publish --access=public

0 comments on commit 6fffa74

Please sign in to comment.