From c0f83524a99d613786b6c598b0509d368fe7a272 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Mon, 18 Oct 2021 00:18:25 -0400 Subject: [PATCH] actions-linux: Update linux workflow to upload artifacts to release --- .github/workflows/linux-workflow.yml | 108 +++++++++++++-------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/.github/workflows/linux-workflow.yml b/.github/workflows/linux-workflow.yml index 667d4e84ea..70fdfda63a 100644 --- a/.github/workflows/linux-workflow.yml +++ b/.github/workflows/linux-workflow.yml @@ -6,59 +6,36 @@ on: push: branches: - master - paths-ignore: - - '**/*.md' - - '**/*.bat' - - '**/*.cmd' - - '**/*.props' - - '**/*.sln' - - '.clang-format' - - '.codacy.yaml' - - '.github/*' - - '.github/workflows/lint-gamedb.yml' - - '.github/workflows/macos-workflow.yml' - - '.github/workflows/pr-triage.yml' - - '.github/workflows/scripts/windows/**' - - '.github/workflows/scripts/validation/**' - - '.github/workflows/windows-workflow.yml' - - '.gitignore' - - 'bin/PCSX2_keys.ini.default' - - 'build.sh' - - 'buildbot.xml' - - 'pcsx2/CDVD/Windows/**' - - 'pcsx2/DEV9/Win32/**' - - 'pcsx2/PAD/Windows/**' - - 'pcsx2/SPU2/Windows/**' - - 'pcsx2/USB/Win32/**' - - 'pcsx2/windows/**' + tags: + - v* pull_request: branches: - master paths-ignore: - - '**/*.md' - - '**/*.bat' - - '**/*.cmd' - - '**/*.props' - - '**/*.sln' - - '.clang-format' - - '.codacy.yaml' - - '.github/*' - - '.github/workflows/lint-gamedb.yml' - - '.github/workflows/macos-workflow.yml' - - '.github/workflows/pr-triage.yml' - - '.github/workflows/scripts/windows/**' - - '.github/workflows/scripts/validation/**' - - '.github/workflows/windows-workflow.yml' - - '.gitignore' - - 'bin/PCSX2_keys.ini.default' - - 'build.sh' - - 'buildbot.xml' - - 'pcsx2/CDVD/Windows/**' - - 'pcsx2/DEV9/Win32/**' - - 'pcsx2/PAD/Windows/**' - - 'pcsx2/SPU2/Windows/**' - - 'pcsx2/USB/Win32/**' - - 'pcsx2/windows/**' + - "**/*.md" + - "**/*.bat" + - "**/*.cmd" + - "**/*.props" + - "**/*.sln" + - ".clang-format" + - ".codacy.yaml" + - ".github/*" + - ".github/workflows/lint-gamedb.yml" + - ".github/workflows/macos-workflow.yml" + - ".github/workflows/pr-triage.yml" + - ".github/workflows/scripts/windows/**" + - ".github/workflows/scripts/validation/**" + - ".github/workflows/windows-workflow.yml" + - ".gitignore" + - "bin/PCSX2_keys.ini.default" + - "build.sh" + - "buildbot.xml" + - "pcsx2/CDVD/Windows/**" + - "pcsx2/DEV9/Win32/**" + - "pcsx2/PAD/Windows/**" + - "pcsx2/SPU2/Windows/**" + - "pcsx2/USB/Win32/**" + - "pcsx2/windows/**" jobs: build: @@ -86,18 +63,21 @@ jobs: # (PCH conflicts with ccache, fixed by https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4400) cmakeflags: -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON detail: " nopch" + appimage: false experimental: false - os: ubuntu-18.04 platform: x86 compiler: gcc cmakeflags: -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON detail: " nopch" + appimage: false experimental: false - os: ubuntu-18.04 platform: x86 compiler: gcc cmakeflags: -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON -DARCH_FLAG=-march=haswell detail: " avx2 nopch" + appimage: false experimental: false name: ${{ matrix.platform }} | ${{ matrix.compiler }}${{ matrix.detail }} @@ -169,7 +149,8 @@ jobs: TRIMMED_ARTIFACT_NAME=$(printf "%.199s]" "$ARTIFACT_NAME") echo "name=$TRIMMED_ARTIFACT_NAME" echo "##[set-output name=name;]${TRIMMED_ARTIFACT_NAME}" - + echo "##[set-output name=arch;]${ARCH}" + - name: Install Packages env: PLATFORM: ${{ matrix.platform }} @@ -190,18 +171,37 @@ jobs: - name: Run Tests working-directory: ./build run: ninja unittests - + - name: Package AppImage + if: matrix.appimage == true env: PLATFORM: ${{ matrix.platform }} COMPILER: ${{ matrix.compiler }} name: ${{ steps.artifact-metadata.outputs.name }} run: .github/workflows/scripts/linux/appimage.sh - if: ${{ matrix.appimage }} - name: Upload artifact + if: matrix.appimage == true uses: actions/upload-artifact@v2 with: name: ${{ steps.artifact-metadata.outputs.name }} - path: artifacts - if: ${{ matrix.appimage }} + path: ci-artifacts + + # ---- Release / Tagging related steps ---- + - name: Prepare Build Artifacts + if: startsWith(github.ref, 'refs/tags/') && matrix.appimage == true + run: | + mv ./ci-artifacts/*.AppImage ./ci-artifacts/linux-AppImage-${{ steps.artifact-metadata.outputs.arch }}.AppImage + ls ./ci-artifacts/ + + - name: Upload Assets and Potential Publish Release + if: startsWith(github.ref, 'refs/tags/') && matrix.appimage == true + env: + GITHUB_TOKEN: ${{ secrets.BOT_PAT }} + ASSET_DIR: ${{ github.WORKSPACE }}/ci-artifacts + ASSET_EXTENSION: "AppImage" + TAG_TO_SEARCH_FOR: ${{ github.REF }} + run: | + cd ./.github/workflows/scripts/releases/upload-release-artifacts + npm ci + node index.js