From 87008256bd28f7cf889dabd45fb9f70e6530bfe7 Mon Sep 17 00:00:00 2001 From: MoetaYuko Date: Sun, 19 Nov 2023 19:30:42 +0800 Subject: [PATCH] chore(ci): release on push tags --- .github/workflows/build-epyc7002.yml | 39 +++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-epyc7002.yml b/.github/workflows/build-epyc7002.yml index ece70046..420e20b5 100644 --- a/.github/workflows/build-epyc7002.yml +++ b/.github/workflows/build-epyc7002.yml @@ -2,6 +2,9 @@ name: Build i915 for DSM epyc7002 on: workflow_dispatch: + push: + tags: + - "*-dsm-*" jobs: build: @@ -11,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download toolchain run: | @@ -35,8 +38,36 @@ jobs: make defconfig-drm make -j$(nproc) modules_copy - - name: Save Build Result + - name: Pack modules + run: zip -j i915_dsm-${{ matrix.version }}_epyc7002.zip out/modules/* + + - name: Save to artifacts uses: actions/upload-artifact@v3 with: - name: i915_dsm-${{ matrix.version }}_epyc7002 - path: out/modules/ + path: i915_dsm-${{ matrix.version }}_epyc7002.zip + + release: + if: startsWith(github.ref, 'refs/tags/') + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + + - name: Append tag to filename + working-directory: artifacts + run: | + find . -name "i915_dsm-*.zip" -print0 | while read -d $'\0' f; do + mv $f ${f%.*}_${GITHUB_REF##*/}.zip + done + + - name: Release + uses: softprops/action-gh-release@v1 + with: + body_path: versions + files: artifacts/**/i915_dsm-*.zip