Skip to content

Commit

Permalink
Merge branch 'main' into PSG-5154-new-class-method-name
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeshong authored Nov 20, 2024
2 parents b631090 + ca17494 commit 8737cd9
Show file tree
Hide file tree
Showing 4 changed files with 93 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/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
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

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

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
# https://github.com/googleapis/release-please-action?tab=readme-ov-file#creating-majorminor-tags
- name: Tag versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/googleapis/release-please-action.git"
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.11.2"
}
16 changes: 16 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "go",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": false,
"extra-files": [
"version.txt"
]
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

0 comments on commit 8737cd9

Please sign in to comment.