From 612dc598a052c6796f3e3a27fa05fb81668e21fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristina=20Ca=C3=B1izales?= <113132642+CristiCanizales@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:18:09 -0300 Subject: [PATCH] chore: update workflows (#629) Co-authored-by: peternhale --- .github/workflows/create-github-release.yml | 25 ++++++++++++++ .github/workflows/manualRelease.yml | 36 --------------------- .github/workflows/onPushToMain.yml | 11 ------- .github/workflows/slackNotification.yml | 2 +- 4 files changed, 26 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/create-github-release.yml delete mode 100644 .github/workflows/manualRelease.yml delete mode 100644 .github/workflows/onPushToMain.yml diff --git a/.github/workflows/create-github-release.yml b/.github/workflows/create-github-release.yml new file mode 100644 index 00000000..7a21c72d --- /dev/null +++ b/.github/workflows/create-github-release.yml @@ -0,0 +1,25 @@ +name: create-github-release + +on: + push: + branches: + - main + - prerelease/** + tags-ignore: + - '*' + workflow_dispatch: + inputs: + prerelease: + type: string + description: 'Name to use for the prerelease: beta, dev, etc. NOTE: If this is already set in the package.json, it does not need to be passed in here.' + +jobs: + release: + uses: salesforcecli/github-workflows/.github/workflows/create-github-release.yml@main + secrets: inherit + with: + prerelease: ${{ inputs.prerelease }} + # If this is a push event, we want to skip the release if there are no semantic commits + # However, if this is a manual release (workflow_dispatch), then we want to disable skip-on-empty + # This helps recover from forgetting to add semantic commits ('fix:', 'feat:', etc.) + skip-on-empty: ${{ github.event_name == 'push' }} diff --git a/.github/workflows/manualRelease.yml b/.github/workflows/manualRelease.yml deleted file mode 100644 index 44441be2..00000000 --- a/.github/workflows/manualRelease.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Manual Release - -on: - workflow_dispatch: - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.IDEE_GH_TOKEN }} - - name: Conventional Changelog Action - id: changelog - uses: TriPSs/conventional-changelog-action@d360fad3a42feca6462f72c97c165d60a02d4bf2 - # overriding some of the basic behaviors to just get the changelog - with: - git-user-name: Release Bot - git-user-email: ${{ secrets.IDEE_GH_EMAIL }} - github-token: ${{ secrets.IDEE_GH_TOKEN }} - output-file: false - # always do the release, even if there are no semantic commits - skip-on-empty: false - tag-prefix: '' - - uses: notiz-dev/github-action-json-property@7a701887f4b568b23eb7b78bb0fc49aaeb1b68d3 - id: packageVersion - with: - path: 'package.json' - prop_path: 'version' - - name: Create Github Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} - with: - tag_name: ${{ steps.packageVersion.outputs.prop }} - release_name: ${{ steps.packageVersion.outputs.prop }} diff --git a/.github/workflows/onPushToMain.yml b/.github/workflows/onPushToMain.yml deleted file mode 100644 index 445d2c89..00000000 --- a/.github/workflows/onPushToMain.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Version, Tag and Github Release - -on: - push: - branches: [main] - -jobs: - release: - uses: salesforcecli/github-workflows/.github/workflows/githubRelease.yml@main - secrets: - SVC_CLI_BOT_GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }} diff --git a/.github/workflows/slackNotification.yml b/.github/workflows/slackNotification.yml index 9ce50b29..d6f362af 100644 --- a/.github/workflows/slackNotification.yml +++ b/.github/workflows/slackNotification.yml @@ -3,7 +3,7 @@ name: Slack Notification on: workflow_run: workflows: - - version, tag and github release + - create-github-release - publish types: - completed