Skip to content

Commit

Permalink
feat(config): add comprehensive prepare release workflow for visualiz…
Browse files Browse the repository at this point in the history
…ation and analysis
  • Loading branch information
IhsenBouallegue committed Dec 12, 2024
1 parent d79519c commit 5c80e71
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prepare Release (Visualization/Analysis)
name: Prepare Release - Visualization/Analysis

on:
workflow_dispatch:
Expand Down Expand Up @@ -27,6 +27,7 @@ jobs:
prefix: ${{ steps.version.outputs.prefix }}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -46,18 +47,35 @@ jobs:
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
echo "prefix=${{ inputs.repository == 'Visualization' && 'vis' || 'ana' }}" >> $GITHUB_OUTPUT
- name: Commit and tag changes
- name: Create release branch and commit changes
run: |
# Create a new branch
git checkout -b release/${{ steps.version.outputs.prefix }}-${{ steps.version.outputs.new_version }}
# Stage and commit changes
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Releasing ${{ steps.version.outputs.prefix }}-${{ steps.version.outputs.new_version }} [skip ci]"
# Create tag (will be pushed with the merge)
git tag "${{ steps.version.outputs.prefix }}-${{ steps.version.outputs.new_version }}"
git push --follow-tags
# Push branch
git push origin release/${{ steps.version.outputs.prefix }}-${{ steps.version.outputs.new_version }}
- name: Trigger release workflow
run: |
gh workflow run "Release ${{ inputs.repository }}" \
--ref "${{ steps.version.outputs.prefix }}-${{ steps.version.outputs.new_version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release pull request
uses: peter-evans/create-pull-request@v5
with:
title: "Release ${{ inputs.repository }} ${{ steps.version.outputs.new_version }}"
body: |
Automated PR for releasing ${{ inputs.repository }} version ${{ steps.version.outputs.new_version }}
This PR was automatically created by the release workflow.
After merging, the tag `${{ steps.version.outputs.prefix }}-${{ steps.version.outputs.new_version }}` will trigger the release workflow.
branch: release/${{ steps.version.outputs.prefix }}-${{ steps.version.outputs.new_version }}
base: main
labels: release
delete-branch: true

# The appropriate release workflow will be triggered after the PR is merged
6 changes: 1 addition & 5 deletions .github/workflows/release-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# WARNING: Do not change the name of this workflow as it is referenced by the release.yml workflow
name: Release Analysis
name: Release - Analysis

on:
workflow_dispatch:
# This workflow is triggered by the release.yml workflow after version updates
# The tag-based trigger is kept for backward compatibility
push:
tags: 'ana-*.*.*'

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/release-visualization.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# WARNING: Do not change the name of this workflow as it is referenced by the release.yml workflow
name: Release Visualization
name: Release - Visualization

on:
workflow_dispatch:
# This workflow is triggered by the release.yml workflow after version updates
# The tag-based trigger is kept for backward compatibility
push:
tags: 'vis-*.*.*'

Expand Down

0 comments on commit 5c80e71

Please sign in to comment.