|
4 | 4 | types: [published] |
5 | 5 |
|
6 | 6 | jobs: |
| 7 | + update-docker-tags: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + permissions: |
| 10 | + contents: write |
| 11 | + steps: |
| 12 | + - name: Checkout release tag |
| 13 | + uses: actions/checkout@v4 |
| 14 | + with: |
| 15 | + ref: ${{ github.event.release.tag_name }} |
| 16 | + fetch-depth: 0 |
| 17 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + |
| 19 | + - name: Configure Git |
| 20 | + run: | |
| 21 | + git config user.name "github-actions[bot]" |
| 22 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 23 | +
|
| 24 | + - name: Extract release tag |
| 25 | + id: release_tag |
| 26 | + run: | |
| 27 | + TAG_NAME="${{ github.event.release.tag_name }}" |
| 28 | + echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT |
| 29 | + echo "Release tag: ${TAG_NAME}" |
| 30 | +
|
| 31 | + - name: Update docker-compose.yml to use release tags |
| 32 | + run: | |
| 33 | + RELEASE_TAG="${{ steps.release_tag.outputs.TAG_NAME }}" |
| 34 | + # Update all :develop tags to the release tag |
| 35 | + sed -i.bak "s/:develop/:${RELEASE_TAG}/g" docker-compose.yml |
| 36 | + rm docker-compose.yml.bak |
| 37 | + echo "Updated docker-compose.yml with release tag: ${RELEASE_TAG}" |
| 38 | + # Show the changes |
| 39 | + git diff docker-compose.yml || true |
| 40 | +
|
| 41 | + - name: Commit and update release tag |
| 42 | + run: | |
| 43 | + RELEASE_TAG="${{ steps.release_tag.outputs.TAG_NAME }}" |
| 44 | + |
| 45 | + git add docker-compose.yml |
| 46 | + if ! git diff --staged --quiet; then |
| 47 | + # Create a new commit with updated docker-compose.yml |
| 48 | + git commit -m "chore: update image tags to ${RELEASE_TAG} for release" |
| 49 | + |
| 50 | + # Update the tag to point to the new commit |
| 51 | + git tag -f ${RELEASE_TAG} |
| 52 | + git push origin ${RELEASE_TAG} --force |
| 53 | + echo "Updated release tag ${RELEASE_TAG} with docker-compose.yml changes" |
| 54 | + else |
| 55 | + echo "No changes to commit (docker-compose.yml already has release tags)" |
| 56 | + fi |
| 57 | +
|
7 | 58 | build-installer-and-upload-installer: |
| 59 | + needs: [update-docker-tags] |
8 | 60 | runs-on: ubuntu-latest |
9 | 61 | steps: |
10 | 62 |
|
11 | 63 | - name: Checkout OpenELIS-Global2 |
12 | | - uses: actions/checkout@v2 |
| 64 | + uses: actions/checkout@v4 |
13 | 65 | with: |
| 66 | + ref: ${{ github.event.release.tag_name }} |
14 | 67 | repository: ${{github.repository}} |
| 68 | + fetch-depth: 0 |
| 69 | + token: ${{ secrets.GITHUB_TOKEN }} |
15 | 70 |
|
16 | 71 | - name: Build installer |
17 | | - run: ./build.sh ${{github.ref_name}} ${{github.ref_name}} |
| 72 | + run: ./build.sh ${{ github.event.release.tag_name }} ${{ github.event.release.tag_name }} |
18 | 73 |
|
19 | 74 | - name: check installer |
20 | 75 | run: ls OEDockerInstaller |
|
0 commit comments