Skip to content

Commit

Permalink
Merge pull request #17 from idaholab/release-please-action
Browse files Browse the repository at this point in the history
Added Release-Please action
  • Loading branch information
manoj1511 authored Jul 17, 2024
2 parents 225d536 + 1a39169 commit 2cffdd9
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release-please-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and Release

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
build-release:
runs-on: ubuntu-latest

steps:

- name: Checkout git repo
uses: actions/checkout@v4

- name: release-please
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.ACTIONS_SECRET }}
release-type: simple
target-branch: ${{ github.ref_name }}

- name: Print release outputs for debugging
run: |
echo "Release outputs:"
echo "releases_created: ${{ steps.release.outputs.releases_created }}"
echo "major: ${{ steps.release.outputs.major }}"
echo "minor: ${{ steps.release.outputs.minor }}"
- name: tag major and minor versions
if: ${{ steps.release.outputs.releases_created == 'true' }}
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 }}

0 comments on commit 2cffdd9

Please sign in to comment.