Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Commit 178e96b

Browse files
authored
ci: adds release as ci (#109)
* ci: adds release-please workflow * ci: adds release-as workflow * ci: sets fetch depth to 0 to pull all refs and uses org PAT to merge PR bypassing status checks
1 parent 75c4b58 commit 178e96b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/release-as.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release As
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Major.Minor.Patch'
8+
required: true
9+
10+
jobs:
11+
release-as:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Get latest tag
18+
id: latest-tag
19+
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
20+
- uses: jackbilestech/semver-compare@1.0.4
21+
with:
22+
head: ${{ inputs.version }}
23+
base: ${{ steps.latest-tag.outputs.tag }}
24+
operator: '>'
25+
# https://github.com/googleapis/release-please?tab=readme-ov-file#how-do-i-change-the-version-number
26+
- name: Release as
27+
run: |
28+
git config user.name github-actions[bot]
29+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
30+
git switch -c release-as-v${{ github.event.inputs.version }}
31+
git commit --allow-empty -m "chore: release ${{ github.event.inputs.version }}" -m "Release-As: ${{ github.event.inputs.version }}"
32+
git push origin release-as-v${{ github.event.inputs.version }}
33+
gh pr create --title "chore: Release as v${{ github.event.inputs.version }}" --body "Release as v${{ github.event.inputs.version }}" --base main
34+
gh pr merge --squash --delete-branch --admin
35+
env:
36+
GH_TOKEN: ${{ secrets.BE_SDK_PAT }}
37+
call-release-workflow:
38+
needs: release-as
39+
uses: ./.github/workflows/release.yml
40+
secrets: inherit

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Release
22

33
on:
44
workflow_dispatch:
5+
workflow_call:
56
push:
67
branches:
78
- main

0 commit comments

Comments
 (0)