From ca1749494ec3c9b4f7f38aab82eddd5ecbef90af Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Tue, 19 Nov 2024 12:31:40 -0600 Subject: [PATCH] ci: adds release as ci (#104) * chore: bootstrap releases for path: . * ci: add release please workflow * ci: add release as workflow --- .github/workflows/release-as.yml | 38 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 1 + 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/release-as.yml diff --git a/.github/workflows/release-as.yml b/.github/workflows/release-as.yml new file mode 100644 index 0000000..97c0a87 --- /dev/null +++ b/.github/workflows/release-as.yml @@ -0,0 +1,38 @@ +name: Release As + +on: + workflow_dispatch: + inputs: + version: + description: 'Major.Minor.Patch' + required: true + +jobs: + release-as: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get latest tag + id: latest-tag + run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT + - uses: jackbilestech/semver-compare@1.0.4 + with: + head: ${{ inputs.version }} + base: ${{ steps.latest-tag.outputs.tag }} + operator: '>' + # https://github.com/googleapis/release-please?tab=readme-ov-file#how-do-i-change-the-version-number + - name: Release as + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git switch -c release-as-v${{ github.event.inputs.version }} + git commit --allow-empty -m "chore: release ${{ github.event.inputs.version }}" -m "Release-As: ${{ github.event.inputs.version }}" + git push origin release-as-v${{ github.event.inputs.version }} + gh pr create --title "chore: Release as v${{ github.event.inputs.version }}" --body "Release as v${{ github.event.inputs.version }}" --base main + gh pr merge --squash --delete-branch + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + call-release-workflow: + needs: release-as + uses: ./.github/workflows/release.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afcddb3..64e024d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,7 @@ name: Release on: workflow_dispatch: + workflow_call: push: branches: - main