Skip to content

Commit

Permalink
ci: adds release as ci (#104)
Browse files Browse the repository at this point in the history
* chore: bootstrap releases for path: .

* ci: add release please workflow

* ci: add release as workflow
  • Loading branch information
ctran88 authored Nov 19, 2024
1 parent a12566b commit ca17494
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release-as.yml
Original file line number Diff line number Diff line change
@@ -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/[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
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
call-release-workflow:
needs: release-as
uses: ./.github/workflows/release.yml
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Release

on:
workflow_dispatch:
workflow_call:
push:
branches:
- main
Expand Down

0 comments on commit ca17494

Please sign in to comment.