Skip to content

Commit

Permalink
Updated release process to use actions
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Raineri <[email protected]>
  • Loading branch information
mraineri committed Apr 6, 2023
1 parent 0571c46 commit 514e48e
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 45 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Release and Publish
on:
workflow_dispatch:
inputs:
version:
description: 'Version number'
required: true
changes_1:
description: 'Change entry'
required: true
changes_2:
description: 'Change entry'
required: false
changes_3:
description: 'Change entry'
required: false
changes_4:
description: 'Change entry'
required: false
changes_5:
description: 'Change entry'
required: false
changes_6:
description: 'Change entry'
required: false
changes_7:
description: 'Change entry'
required: false
changes_8:
description: 'Change entry'
required: false
jobs:
release_build:
name: Build the release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{secrets.GITHUB_TOKEN}}
- name: Build the changelog text
run: |
echo 'CHANGES<<EOF' >> $GITHUB_ENV
echo "## [${{github.event.inputs.version}}] - $(date +'%Y-%m-%d')" >> $GITHUB_ENV
echo "- ${{github.event.inputs.changes_1}}" >> $GITHUB_ENV
if [[ -n "${{github.event.inputs.changes_2}}" ]]; then echo "- ${{github.event.inputs.changes_2}}" >> $GITHUB_ENV; fi
if [[ -n "${{github.event.inputs.changes_3}}" ]]; then echo "- ${{github.event.inputs.changes_3}}" >> $GITHUB_ENV; fi
if [[ -n "${{github.event.inputs.changes_4}}" ]]; then echo "- ${{github.event.inputs.changes_4}}" >> $GITHUB_ENV; fi
if [[ -n "${{github.event.inputs.changes_5}}" ]]; then echo "- ${{github.event.inputs.changes_5}}" >> $GITHUB_ENV; fi
if [[ -n "${{github.event.inputs.changes_6}}" ]]; then echo "- ${{github.event.inputs.changes_6}}" >> $GITHUB_ENV; fi
if [[ -n "${{github.event.inputs.changes_7}}" ]]; then echo "- ${{github.event.inputs.changes_7}}" >> $GITHUB_ENV; fi
if [[ -n "${{github.event.inputs.changes_8}}" ]]; then echo "- ${{github.event.inputs.changes_8}}" >> $GITHUB_ENV; fi
echo "" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Update version numbers
run: |
sed -i -E 's/Version:\t.+/Version:\t'${{github.event.inputs.version}}'/' rpm/libredfish.spec
- name: Update the changelog
run: |
ex CHANGELOG.md <<eof
3 insert
$CHANGES
.
xit
eof
- name: Commit and push the updates
run: |
git config user.name "GitHub Release Workflow"
git config user.email "<>"
git add CHANGELOG.md rpm/libredfish.spec
git commit -s -m "${{github.event.inputs.version}} versioning"
git push origin main
- name: Make the release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{github.event.inputs.version}}
release_name: ${{github.event.inputs.version}}
body: |
Changes since last release:
${{env.CHANGES}}
draft: false
prerelease: false
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,10 @@ int main(int argc, char** argv)
}
```
# Release Process
## Release Process
Run the `release.sh` script to publish a new version.
```bash
sh release.sh <NewVersion>
```

Enter the release notes when prompted; an empty line signifies no more notes to add.
1. Go to the "Actions" page
2. Select the "Release and Publish" workflow
3. Click "Run workflow"
4. Fill out the form
5. Click "Run workflow"
37 changes: 0 additions & 37 deletions release.sh

This file was deleted.

0 comments on commit 514e48e

Please sign in to comment.