From 0c2acb60580efaec154ae3a4c39b763315d19d0e Mon Sep 17 00:00:00 2001 From: mcaulifn Date: Tue, 22 Aug 2023 14:12:48 -0400 Subject: [PATCH] chore(release): Use release-please --- .github/workflows/release.yaml | 48 ++++++++++++++++------------------ .github/workflows/test.yaml | 11 ++++++++ .release-please-manifest.json | 3 +++ .releaserc.yaml | 32 ----------------------- release-please-config.json | 13 +++++++++ 5 files changed, 50 insertions(+), 57 deletions(-) create mode 100644 .release-please-manifest.json delete mode 100644 .releaserc.yaml create mode 100644 release-please-config.json diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bfabe10..7c77644 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 }}' + }) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index db64900..d060312 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..42cbae5 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.3" +} diff --git a/.releaserc.yaml b/.releaserc.yaml deleted file mode 100644 index 7df09be..0000000 --- a/.releaserc.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: semantic-versioning -version: 1.0.0 -description: Semantic release support for tagging `spinnaker-pipeline-trigger` with semantic versioning. -repository: - type: git - url: https://github.com/ExpediaGroup/spinnaker-pipeline-trigger -keywords: [] -author: "" -license: ISC -devDependencies: - semantic-release: ^17.4.4 -plugins: - - - "@semantic-release/commit-analyzer" - - preset: angular - releaseRules: - - breaking: true - release: major - - type: breaking - release: major - - type: docs - release: patch - - type: refactor - release: patch - - scope: no-release - release: false - - "@semantic-release/release-notes-generator" - - "@semantic-release/github" -release: - branches: - - main -branches: - - main diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..588232e --- /dev/null +++ b/release-please-config.json @@ -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" +}