Skip to content

Commit

Permalink
add release-scripts workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
max402 committed May 2, 2024
1 parent 31182c1 commit a9e379e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/release-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
workflow_dispatch:
inputs:
version:
type: string
required: true
description: "Version to release"

name: Release

jobs:
release_workflow:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Step 1 - Checkout repository code
uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 0
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}

- name: Step 2 - Run release-scripts
env:
VERSION: ${{ inputs.version }}
GITHUB_TOKEN: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
run: |
NEXT_VERSION="$(echo '${{ inputs.version }}' | perl -pe 's{^(([0-9]\.)+)?([0-9]+)$}{$1 . ($3 + 1)}e')"
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
./release-scripts/release.sh -v $VERSION $NEXT_VERSION
echo $(git log -5 --oneline)
git push --atomic origin master develop --follow-tags # all or nothing
- name: Step 3 - Create release notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="$(git describe --abbrev=0)"
echo $TAG
gh release create "$TAG" --repo="$GITHUB_REPOSITORY" --title="${GITHUB_REPOSITORY#*/} ${TAG#v}" --generate-notes
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
runs-on: ubuntu-22-04
runs-on: ubuntu-latest
steps:
- name: Step 1 - Checkout repository code
uses: actions/checkout@v4
Expand Down

0 comments on commit a9e379e

Please sign in to comment.