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