Skip to content

Commit

Permalink
chore(release): Use release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
mcaulifn committed Aug 22, 2023
1 parent 2d483f4 commit 0c2acb6
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 57 deletions.
48 changes: 23 additions & 25 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
---
name: Release

on:
push:
branches:
- main

permissions:
actions: write
contents: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: release
name: Run release please
uses: google-github-actions/release-please-action@v3
with:
command: manifest
- if: steps.release.outputs.releases_created && inputs.publish-workflow != ''
name: Trigger Publish
uses: actions/github-script@v6
with:
fetch-depth: 0
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- uses: actions/setup-node@v3
- run: |
yarn
- run: |
yarn all
- name: Check for diff
id: diff
run: echo "::set-output name=GIT_STATUS::$(git status -s dist/)"
- name: Push build
if: ${{ steps.diff.outputs.GIT_STATUS != '' }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add dist/*
git commit -m "chore: Build Source"
git push
- run: |
npm install semantic-release semantic-release/git
npx semantic-release --debug --no-ci
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
github-token: ${{ (secrets.github-token != '' && secrets.github-token) || secrets.GITHUB_TOKEN }}
retries: 3
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: '${{ inputs.publish-workflow }}',
ref: '${{ steps.release.outputs.tag_name }}'
})
11 changes: 11 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ jobs:
yarn
- run: |
yarn all
- name: Check for diff
id: diff
run: echo "::set-output name=GIT_STATUS::$(git status -s dist/)"
- name: Push build
if: ${{ steps.diff.outputs.GIT_STATUS != '' }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add dist/*
git commit -m "chore: Build Source"
git push
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.3"
}
32 changes: 0 additions & 32 deletions .releaserc.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "simple",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": false
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

0 comments on commit 0c2acb6

Please sign in to comment.