Skip to content

Commit

Permalink
Version Update to trigger on release.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfiex authored Mar 5, 2024
1 parent 56f4de5 commit 1d3ff3d
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/version_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ name: File Versioning
on:
push:
branches:
- '*'
tags:
- '*'
- 'main'
# tags:
# - '*'
release:
types:
- 'created'

jobs:
update_versioning:
runs-on: ubuntu-latest
outputs:
steps_completed: ${{ steps.steps_completed.outputs.run-python-script }}

env:
API_KEY: ${{ secrets.API_KEY }}
Expand Down Expand Up @@ -53,8 +58,13 @@ jobs:
- name: Update Versioning
id: run-python-script
run: |
if [[ "${{ github.event_name }}" == "push" && "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
git pull origin main
echo "${{github.event_name}} ${{github.ref}}"
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "This is a tag release."
# && "${{ startsWith(github.ref, 'refs/tags/') }}" == "true"
git checkout main
git pull origin main
export TAG_NAME=$(echo "${{ github.ref }}" | sed 's|refs/tags/||')
python .github/libs/version.py -t ${GH_TOKEN} -b $(git rev-parse --abbrev-ref HEAD) -n ${TAG_NAME}
else
Expand All @@ -71,12 +81,10 @@ jobs:
- name: Write Changes
run: |
if [ -z "$ACT" ]; then
# timestamp=$(date -u +"%Y-%m-%d %H:%M UTC")
# git add -A
# git commit -m 'Automated Versioning Update'
git push origin $(git rev-parse --abbrev-ref HEAD)
git push origin main
else
echo "Skipping this step in 'act' environment."
fi
shell: bash
continue-on-error: true
continue-on-error: true

0 comments on commit 1d3ff3d

Please sign in to comment.