From 1dc707c9f0e0a9dfd2e987de204e46954f3e176e Mon Sep 17 00:00:00 2001 From: Nick Le Large Date: Thu, 21 Nov 2024 07:40:22 +0100 Subject: [PATCH] Adjust workflow for testing purposes --- ...create-release-and-push-docker-images.yaml | 279 +++++++++--------- 1 file changed, 140 insertions(+), 139 deletions(-) diff --git a/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml b/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml index 427e29cb..15c1a2b0 100644 --- a/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml +++ b/.github/workflows/bump-version-and-create-release-and-push-docker-images.yaml @@ -1,14 +1,15 @@ name: Bump version, create and test release, and push Docker images on: - pull_request: - types: - - closed - branches: - - main + push: + # pull_request: + # types: + # - closed + # branches: + # - main jobs: compute-version: - if: github.event.pull_request.merged == true + # if: github.event.pull_request.merged == true runs-on: ubuntu-latest permissions: contents: write @@ -21,7 +22,7 @@ jobs: - name: Compute new version id: bump_version env: - PR_BODY: ${{ github.event.pull_request.body }} + PR_BODY: ${{ github.event.head_commit.message }} run: | source version new_version=$(.github/workflows/compute_version.sh "$VERSION" "${PR_BODY//[^a-zA-Z0-9#]/}") @@ -42,135 +43,135 @@ jobs: run: | echo "New version: ${{ needs.compute-version.outputs.new_version }}" echo "VERSION=${{ needs.compute-version.outputs.new_version }}" > version - git config --local user.name "github-actions[bot]" - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git add version - git commit -m "chore: update version file to ${{ needs.compute-version.outputs.new_version }}" - git push - - - name: Push new tag - run: | - git tag ${{ needs.compute-version.outputs.new_version }} - git push origin ${{ needs.compute-version.outputs.new_version }} - - - create-release: - needs: [compute-version, update-version-file] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Check out the repository and pull the new tag - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ needs.compute-version.outputs.new_version }} - - - name: Build release packages - uses: docker/build-push-action@v6 - with: - context: . - push: false - tags: | - release_builder - target: release - - - name: Copy release packages - run: | - mkdir -p /tmp/artifacts/ - docker run --rm -v /tmp/artifacts:/tmp/artifacts release_builder cp -r /release /tmp/artifacts/ - - - name: Create Release - uses: ncipollo/release-action@v1 - with: - artifacts: "/tmp/artifacts/release/*" - tag: ${{ needs.compute-version.outputs.new_version }} - body: ${{ github.event.pull_request.body }} - - build-and-run-release-tests: - needs: [compute-version, create-release] - runs-on: ubuntu-latest - steps: - - name: Build release core test Docker image - uses: docker/build-push-action@v6 - with: - build-args: | - RELEASE_DOWNLOAD_URL=https://github.com/KIT-MRT/arbitration_graphs/releases/download/${{ needs.compute-version.outputs.new_version }} - push: false - tags: release_tester_core - target: release_test_core - - - name: Run core unit tests with/against released version - run: | - docker run --rm release_tester_core - - - name: Build release gui test Docker image - uses: docker/build-push-action@v6 - with: - build-args: | - RELEASE_DOWNLOAD_URL=https://github.com/KIT-MRT/arbitration_graphs/releases/download/${{ needs.compute-version.outputs.new_version }} - push: false - tags: release_tester_gui - target: release_test_gui - - - name: Run gui unit tests with/against released version - run: | - docker run --rm release_tester_gui - - build-and-push-images: - needs: [compute-version, build-and-run-release-tests] - runs-on: ubuntu-latest - steps: - - name: Check out the repository - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: 'linux/amd64,linux/arm64,linux/arm/v7' - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push core library Docker image - uses: docker/build-push-action@v6 - with: - push: true - tags: | - ghcr.io/kit-mrt/arbitration_graphs:latest - ghcr.io/kit-mrt/arbitration_graphs:${{ needs.compute-version.outputs.new_version }} - target: install - - - name: Build and push Pacman demo Docker image - uses: docker/build-push-action@v6 - with: - build-args: | - VERSION=${{ needs.compute-version.outputs.new_version }} - context: demo - file: demo/Dockerfile - push: true - tags: | - ghcr.io/kit-mrt/arbitration_graphs_pacman_demo:latest - ghcr.io/kit-mrt/arbitration_graphs_pacman_demo:${{ needs.compute-version.outputs.new_version }} - target: demo - - - name: Build and push Pacman tutorial Docker image - uses: docker/build-push-action@v6 - with: - build-args: | - VERSION=${{ needs.compute-version.outputs.new_version }} - context: demo - file: demo/Dockerfile - push: true - tags: | - ghcr.io/kit-mrt/arbitration_graphs_pacman_tutorial:latest - ghcr.io/kit-mrt/arbitration_graphs_pacman_tutorial:${{ needs.compute-version.outputs.new_version }} - target: tutorial - + # git config --local user.name "github-actions[bot]" + # git config --local user.email "github-actions[bot]@users.noreply.github.com" + # git add version + # git commit -m "chore: update version file to ${{ needs.compute-version.outputs.new_version }}" + # git push + # + # - name: Push new tag + # run: | + # git tag ${{ needs.compute-version.outputs.new_version }} + # git push origin ${{ needs.compute-version.outputs.new_version }} + # + # + # create-release: + # needs: [compute-version, update-version-file] + # runs-on: ubuntu-latest + # permissions: + # contents: write + # steps: + # - name: Check out the repository and pull the new tag + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # ref: ${{ needs.compute-version.outputs.new_version }} + # + # - name: Build release packages + # uses: docker/build-push-action@v6 + # with: + # context: . + # push: false + # tags: | + # release_builder + # target: release + # + # - name: Copy release packages + # run: | + # mkdir -p /tmp/artifacts/ + # docker run --rm -v /tmp/artifacts:/tmp/artifacts release_builder cp -r /release /tmp/artifacts/ + # + # - name: Create Release + # uses: ncipollo/release-action@v1 + # with: + # artifacts: "/tmp/artifacts/release/*" + # tag: ${{ needs.compute-version.outputs.new_version }} + # body: ${{ github.event.pull_request.body }} + # + # build-and-run-release-tests: + # needs: [compute-version, create-release] + # runs-on: ubuntu-latest + # steps: + # - name: Build release core test Docker image + # uses: docker/build-push-action@v6 + # with: + # build-args: | + # RELEASE_DOWNLOAD_URL=https://github.com/KIT-MRT/arbitration_graphs/releases/download/${{ needs.compute-version.outputs.new_version }} + # push: false + # tags: release_tester_core + # target: release_test_core + # + # - name: Run core unit tests with/against released version + # run: | + # docker run --rm release_tester_core + # + # - name: Build release gui test Docker image + # uses: docker/build-push-action@v6 + # with: + # build-args: | + # RELEASE_DOWNLOAD_URL=https://github.com/KIT-MRT/arbitration_graphs/releases/download/${{ needs.compute-version.outputs.new_version }} + # push: false + # tags: release_tester_gui + # target: release_test_gui + # + # - name: Run gui unit tests with/against released version + # run: | + # docker run --rm release_tester_gui + # + # build-and-push-images: + # needs: [compute-version, build-and-run-release-tests] + # runs-on: ubuntu-latest + # steps: + # - name: Check out the repository + # uses: actions/checkout@v4 + # + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + # with: + # platforms: 'linux/amd64,linux/arm64,linux/arm/v7' + # + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + # + # - name: Log in to the Container registry + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} + # + # - name: Build and push core library Docker image + # uses: docker/build-push-action@v6 + # with: + # push: true + # tags: | + # ghcr.io/kit-mrt/arbitration_graphs:latest + # ghcr.io/kit-mrt/arbitration_graphs:${{ needs.compute-version.outputs.new_version }} + # target: install + # + # - name: Build and push Pacman demo Docker image + # uses: docker/build-push-action@v6 + # with: + # build-args: | + # VERSION=${{ needs.compute-version.outputs.new_version }} + # context: demo + # file: demo/Dockerfile + # push: true + # tags: | + # ghcr.io/kit-mrt/arbitration_graphs_pacman_demo:latest + # ghcr.io/kit-mrt/arbitration_graphs_pacman_demo:${{ needs.compute-version.outputs.new_version }} + # target: demo + # + # - name: Build and push Pacman tutorial Docker image + # uses: docker/build-push-action@v6 + # with: + # build-args: | + # VERSION=${{ needs.compute-version.outputs.new_version }} + # context: demo + # file: demo/Dockerfile + # push: true + # tags: | + # ghcr.io/kit-mrt/arbitration_graphs_pacman_tutorial:latest + # ghcr.io/kit-mrt/arbitration_graphs_pacman_tutorial:${{ needs.compute-version.outputs.new_version }} + # target: tutorial + #