|
14 | 14 | BASE_TAG: latest |
15 | 15 |
|
16 | 16 | jobs: |
17 | | - docker: |
18 | | - runs-on: ubuntu-latest |
19 | | - name: Build & Push Docker |
20 | | - steps: |
21 | | - - name: Checkout |
22 | | - uses: actions/checkout@v4 |
23 | | - |
24 | | - - name: Set up QEMU |
25 | | - uses: docker/setup-qemu-action@v3 |
26 | | - |
27 | | - - name: Set up Docker Buildx |
28 | | - uses: docker/setup-buildx-action@v3 |
29 | | - |
30 | | - - name: Find CMakeLists.txt version |
31 | | - id: cmake_version |
32 | | - run: | |
33 | | - cmake_version=$(grep -oP 'project\(.* VERSION \K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt) |
34 | | - echo "::set-output name=version::${cmake_version}" |
35 | | - |
36 | | - - name: Check if the version tag exist git then skip |
37 | | - id: check_tag |
38 | | - run: | |
39 | | - git tag -l | grep -q "${{ steps.cmake_version.outputs.version }}" && echo "Tag already exists" && exit 1 || echo "Tag does not exist" |
40 | | - continue-on-error: true |
41 | | - |
42 | | - - name: tag the version |
43 | | - if: steps.check_tag.outcome == 'success' |
44 | | - run: | |
45 | | - git config --global user.email "action@github.com" |
46 | | - git config --global user.name "GitHub Action" |
47 | | - git tag -a "${{ steps.cmake_version.outputs.version }}" -m "Version ${{ steps.cmake_version.outputs.version }}" |
48 | | - git push origin "${{ steps.cmake_version.outputs.version }}" |
49 | | - |
50 | | - - name: Login to Docker Hub |
51 | | - uses: docker/login-action@v3 |
52 | | - with: |
53 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
54 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
55 | | - |
56 | | - - name: Build and push RCSSServer |
57 | | - uses: docker/build-push-action@v5 |
58 | | - with: |
59 | | - context: . |
60 | | - file: ./utils/docker/Dockerfile |
61 | | - push: true |
62 | | - tags: "${{ env.BASE_IMAGE }}:latest,${{ env.BASE_IMAGE }}:ubuntu-24-${{ steps.cmake_version.outputs.version }}" |
63 | | - |
64 | | - - name: Docker Hub Description |
65 | | - uses: peter-evans/dockerhub-description@v4 |
66 | | - with: |
67 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
68 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
69 | | - repository: ${{ env.BASE_IMAGE }} |
70 | | - readme-filepath: utils/docker/README.md |
71 | | - short-description: "RoboCup Soccer Simulator Server" |
72 | | - |
73 | 17 | app-image: |
74 | 18 | runs-on: ubuntu-latest |
75 | 19 | name: Build AppImage |
|
0 commit comments