Skip to content

Commit

Permalink
feat: add release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
tuunit committed Aug 31, 2023
1 parent 8474a0c commit e07c5eb
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@ on:

permissions:
contents: write
pull-requests: write

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Update and create tag
run: |
# Setup git
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Create release branch
git checkout -b release/v${{ inputs.version }}
# Update version in documentation and helm plugin config
sed -i 's\--version .*\--version ${{ inputs.version }}\g' docs/quick-start.md
sed -i 's\--version .*\--version ${{ inputs.version }}\g' README.md
Expand All @@ -27,14 +37,12 @@ jobs:
sed -i 's\# Changes since\# \g' CHANGELOG.md
echo -e "# Changes since ${{ inputs.version }}\n$(cat CHANGELOG.md)" > CHANGELOG.md
# Setup git
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Commit, tag and push
git commit -m "release ${{ inputs.version }}"
git commit -am "docs: release ${{ inputs.version }}"
git tag ${{ inputs.version }}
git push --follow-tags
git push --set-upstream origin release/v${{ inputs.version }}
git push origin ${{ inputs.version }}
- name: Create release
env:
Expand All @@ -44,4 +52,10 @@ jobs:
gh release create "${TAG}" \
--title="${TAG}" \
--generate-notes \
--draft
--draft
- name: Create PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create -B main -H release/v${{ inputs.version }} --title 'docs: release ${{ inputs.version }}' --body 'Created by Github action'

0 comments on commit e07c5eb

Please sign in to comment.