From 62725e5c5a9447d00d434b2aa9024893107348cf Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Fri, 20 Dec 2024 18:09:16 +0100 Subject: [PATCH] Release workflow fix Signed-off-by: Janos SUTO --- .github/actions/build/image/action.yaml | 5 --- .github/actions/build/package/action.yaml | 1 + .github/workflows/release.yaml | 52 +++++++++++++++-------- .github/workflows/test.yaml | 7 ++- 4 files changed, 40 insertions(+), 25 deletions(-) diff --git a/.github/actions/build/image/action.yaml b/.github/actions/build/image/action.yaml index b3672eb7..a6e95a7c 100644 --- a/.github/actions/build/image/action.yaml +++ b/.github/actions/build/image/action.yaml @@ -32,11 +32,6 @@ runs: username: ${{ inputs.DOCKER_USERNAME }} password: ${{ inputs.DOCKER_TOKEN }} - - name: Download package - uses: actions/download-artifact@v4 - with: - path: docker - - name: Build image from package uses: docker/build-push-action@v5 with: diff --git a/.github/actions/build/package/action.yaml b/.github/actions/build/package/action.yaml index 310646d6..de5d9777 100644 --- a/.github/actions/build/package/action.yaml +++ b/.github/actions/build/package/action.yaml @@ -30,6 +30,7 @@ runs: - name: Build package id: build-package run: | + uname -a docker run --rm \ -e PROJECT_ID=${{ inputs.PROJECT_ID }} \ -e DISTRO=${{ inputs.DISTRO }} \ diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d45c9de3..dc92e0f4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: Create release +name: Create new release on: push: @@ -16,8 +16,7 @@ permissions: jobs: get-version: runs-on: - - self-hosted - - X64 + - ubuntu-latest outputs: IMAGE_TAG: ${{ steps.get-version.outputs.IMAGE_TAG }} @@ -36,20 +35,34 @@ jobs: id: get-version uses: ./.github/actions/version - build-package: + build-package-amd64: needs: - get-version - strategy: - matrix: - arch: ['amd64','arm64'] + runs-on: + - ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Build package + id: build-package + uses: ./.github/actions/build/package + with: + ARCH: amd64 + COMMIT_ID: ${{ needs.get-version.outputs.COMMIT_ID }} + DISTRO: ${{ env.DISTRO }} + IMAGE_NAME: ${{ env.IMAGE_NAME }}:${{ env.DISTRO }}-${{ matrix.arch }} + PROJECT_ID: 'piler' + VERSION: ${{ needs.get-version.outputs.VERSION }} + + build-package-arm64: + needs: + - get-version runs-on: - self-hosted - - ${{ matrix.arch }} - - outputs: - PACKAGE: ${{ steps.build-package.outputs.PACKAGE }} + - ARM64 steps: - uses: actions/checkout@v4 @@ -58,7 +71,7 @@ jobs: id: build-package uses: ./.github/actions/build/package with: - ARCH: ${{ matrix.arch }} + ARCH: arm64 COMMIT_ID: ${{ needs.get-version.outputs.COMMIT_ID }} DISTRO: ${{ env.DISTRO }} IMAGE_NAME: ${{ env.IMAGE_NAME }}:${{ env.DISTRO }}-${{ matrix.arch }} @@ -68,13 +81,15 @@ jobs: build-image: needs: - get-version - - build-package + - build-package-amd64 + - build-package-arm64 runs-on: - - self-hosted - - X64 + - ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Download packages uses: actions/download-artifact@v4 with: @@ -94,13 +109,14 @@ jobs: create-release: needs: - - build-package + - build-image runs-on: - - self-hosted - - X64 + - ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Download packages uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 87164e7d..5aa85615 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,6 +7,10 @@ on: - synchronize # commit pushed to PR - reopened # closed PR reopened +concurrency: + group: ${{ github.ref_name == 'master' && 'master' || github.ref_name }} + cancel-in-progress: ${{ github.ref_name != 'master' }} + env: ARCHIVE_HOST: test1.acts.hu IMAGE_NAME: sutoj/piler @@ -20,8 +24,7 @@ env: jobs: get-version: runs-on: - - self-hosted - - X64 + - ubuntu-latest outputs: IMAGE_TAG: ${{ steps.get-version.outputs.IMAGE_TAG }}