-
Notifications
You must be signed in to change notification settings - Fork 4
40 lines (38 loc) · 1.49 KB
/
release-as.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
with:
fetch-depth: 0
- name: Get latest tag
id: latest-tag
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
- uses: jackbilestech/[email protected]
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 --admin
env:
GH_TOKEN: ${{ secrets.BE_SDK_PAT }}
call-release-workflow:
needs: release-as
uses: ./.github/workflows/release.yml
secrets: inherit