From 7e4cc39b86214850e2661350ab4aa0eb76eab945 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 17 Feb 2023 11:55:31 +0100 Subject: [PATCH] Update CI to use latest actions --- .github/workflows/pr.yml | 28 ++++++++++----------- .github/workflows/push_image.yml | 42 ++++++++++++++++---------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 38fe07e..6f5d927 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,25 +1,25 @@ name: CI-PR -on: [pull_request] +on: [ pull_request ] jobs: clang-format: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - name: clang-format - run: | - docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source ./include + - uses: actions/checkout@v3 + - name: clang-format + run: | + docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source ./include build-lib: runs-on: ubuntu-22.04 needs: clang-format steps: - - uses: actions/checkout@v2 - - name: build lib - run: | - docker build . -f Dockerfile.buildlocal -t builder - docker run --rm -v ${PWD}:/project builder make - - uses: actions/upload-artifact@master - with: - name: lib - path: "lib/*.a" \ No newline at end of file + - uses: actions/checkout@v3 + - name: build lib + run: | + docker build . -f Dockerfile.buildlocal -t builder + docker run --rm -v ${PWD}:/project builder make + - uses: actions/upload-artifact@master + with: + name: lib + path: "lib/*.a" \ No newline at end of file diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml index cd92f40..601c624 100644 --- a/.github/workflows/push_image.yml +++ b/.github/workflows/push_image.yml @@ -2,32 +2,32 @@ name: Publish Docker Image on: push: branches: - - master + - main jobs: clang-format: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - name: clang-format - run: | - docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source ./include + - uses: actions/checkout@v3 + - name: clang-format + run: | + docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source ./include build: runs-on: ubuntu-latest needs: clang-format steps: - - uses: actions/checkout@master - - name: Get release version - id: get_release_tag - run: | - echo RELEASE_VERSION=$(echo $(date '+%Y%m%d')) >> $GITHUB_ENV - echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//" | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - echo REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}' | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@master - with: - name: ${{ env.REPOSITORY_OWNER }}/${{ env.REPOSITORY_NAME }} - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - snapshot: true - cache: true - tags: "latest, ${{ env.RELEASE_VERSION }}" \ No newline at end of file + - uses: actions/checkout@master + - name: Get release version + id: get_release_tag + run: | + echo RELEASE_VERSION=$(echo $(date '+%Y%m%d')) >> $GITHUB_ENV + echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//" | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + echo REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}' | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + with: + name: ${{ env.REPOSITORY_OWNER }}/${{ env.REPOSITORY_NAME }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + snapshot: true + cache: true + tags: "latest, ${{ env.RELEASE_VERSION }}" \ No newline at end of file