-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial release workflow for bumping versions
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # Enables tag push to OneLife | ||
env: | ||
tag_prefix: 2HOL_v | ||
steps: | ||
- name: Authentication for other repositories | ||
uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ vars.GHA_AUTH_APP_ID }} | ||
private-key: ${{ secrets.GHA_AUTH_PRIVATE_KEY }} | ||
repositories: OneLifeData7 # Enables commit and tag push to OneLifeData7 | ||
|
||
- name: Checkout OneLife | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: twohoursonelife/OneLife | ||
path: OneLife | ||
fetch-tags: true | ||
|
||
- name: Checkout OneLifeData7 | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: twohoursonelife/OneLifeData7 | ||
path: OneLifeData7 | ||
fetch-tags: true | ||
token: ${{ steps.app-token.outputs.token }} | ||
|
||
- name: Calculate next version | ||
run: | | ||
cd OneLifeData7 | ||
old_version=$(git describe --tags --abbrev=0 --match="2HOL_v[0-9]*") | ||
echo "new_version=$($oldVersion + 1)" >> $GITHUB_ENV | ||
echo -n "$new_version" > dataVersionNumber.txt | ||
- name: Commit and tag version bump - OneLifeData7 #TODO does this order work? | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
cwd: OneLifeData7/ | ||
default_author: github_actions | ||
message: Updatated dataVersionNumber to $new_version | ||
tag: $tag_prefix$new_version -m "Tag automatically generated by update script." | ||
new_branch: test-release | ||
|
||
- name: Tag version bump - OneLife | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
cwd: OneLife/ | ||
default_author: github_actions | ||
tag: $tag_prefix$new_version -m "Tag automatically generated by update script." |