Skip to content

Commit

Permalink
ci: update steps and use google-github-actions-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
onlyhom committed Aug 25, 2022
1 parent aa89c79 commit c4a380f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 30 deletions.
56 changes: 26 additions & 30 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

jobs:
build-and-release:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -30,45 +30,41 @@ jobs:
- name: Install dependency
run: pnpm install --frozen-lockfile --silent

- name: Update package version
run: npm --no-git-tag-version version patch

- name: Build
run: pnpm run build

- name: Get package-version
uses: nyaa8/package-version@v1

- name: Generate changelog
uses: charmixer/auto-changelog-action@v1
with:
token: ${{ secrets.GH_TOKEN }}

# - name: Commit updates and push origin
# run: |
# git config user.name "github-actions[bot]"
# git config user.email "github-actions[bot]@users.noreply.github.com"
# git add --all
# git commit -m "release: v${{ env.PACKAGE_VERSION }}"
# git tag 'v${{ env.PACKAGE_VERSION }}'
# git push https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git master --tags

- uses: EndBug/add-and-commit@v9
with:
message: "release: v${{ env.PACKAGE_VERSION }}"
message: "chore: build dist"
committer_name: github-actions[bot]
committer_email: github-actions[bot]@users.noreply.github.com
push: true
tag: "v${{ env.PACKAGE_VERSION }}"

release-and-publish:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
token: ${{ secrets.GH_TOKEN }}
default-branch: master
changelog-types: |
[
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "perf", "section": "Performance", "hidden": false },
{ "type": "refactor", "section": "Refactor", "hidden": false },
{ "type": "docs", "section": "Documentation","hidden": false },
{ "type": "ci", "section": "CI/CD", "hidden": false },
{ "type": "revert", "section": "Reverts", "hidden": true },
{ "type": "test", "section": "Tests", "hidden": true },
{ "type": "build", "section": "Build", "hidden": true },
{ "type": "style", "section": "Styles", "hidden": true },
{ "type": "chore", "section": "Chores", "hidden": true }
]
- name: Publish NPM package
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GH_TOKEN }}
title: "v${{ env.PACKAGE_VERSION }}"
prerelease: false
2 changes: 2 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- ".github/**"
- "dist/**"
- "CHANGELOG.md"
- "package.json"
- "package-lock.json"

jobs:
build-and-deploy:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Semantic PR"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
perf
docs
refactor
chore

0 comments on commit c4a380f

Please sign in to comment.