mirror of
https://github.com/shadoll/redmine-mcp.git
synced 2026-08-28 03:27:56 +00:00
Refactor GitHub Actions workflow to use updated image tag output; streamline chart version bump and appVersion setting
This commit is contained in:
+17
-10
@@ -9,14 +9,13 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
outputs:
|
||||
image_tag: ${{ steps.tag.outputs.value }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set image tag
|
||||
id: tag
|
||||
@@ -46,6 +45,18 @@ jobs:
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
update-chart:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Bump chart version and set appVersion
|
||||
id: chart
|
||||
run: |
|
||||
@@ -56,7 +67,7 @@ jobs:
|
||||
NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
|
||||
|
||||
sed -i "s/^version: .*/version: $NEW_VERSION/" helm/Chart.yaml
|
||||
sed -i "s/^appVersion: .*/appVersion: \"${{ steps.tag.outputs.value }}\"/" helm/Chart.yaml
|
||||
sed -i "s/^appVersion: .*/appVersion: \"${{ needs.build.outputs.image_tag }}\"/" helm/Chart.yaml
|
||||
|
||||
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
@@ -65,9 +76,5 @@ jobs:
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add helm/Chart.yaml
|
||||
if git diff --cached --quiet; then
|
||||
echo "No changes to commit; skipping commit and push."
|
||||
else
|
||||
git commit -m "chore: chart ${{ steps.chart.outputs.version }}, appVersion ${{ steps.tag.outputs.value }} [skip ci]"
|
||||
git push
|
||||
fi
|
||||
git commit -m "chore: chart ${{ steps.chart.outputs.version }}, appVersion ${{ needs.build.outputs.image_tag }} [skip ci]"
|
||||
git push
|
||||
|
||||
Reference in New Issue
Block a user