From 0b686e86d954b6098227fdfb3c5f58c4589a306d Mon Sep 17 00:00:00 2001 From: Ian Wijma Date: Mon, 20 Nov 2023 23:47:04 +1100 Subject: [PATCH] Update build.yaml to streamline compilation and packaging process This commit simplifies and optimizes the build workflow process by leveraging the rust-build action for compiling and releasing. The "build.yaml" file has been revised to include different targets and types of archives as per the platform. Also, previous separate jobs for checking out, installing dependencies, building project, and creating/uploading archives have been removed. The new strategy is aimed to reduce redundancy, speed up the process, and allow seamless multi-platform build support. --- .github/workflows/build.yaml | 51 +++++++++++++----------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index dc51bf2..e30881d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,42 +1,27 @@ name: Keep Running -run-name: ${{ gitea.actor }} is running spotify.local CI pipeline 🚀 +run-name: ${{ gitea.actor }} is running the Keep Running build process 🚀 on: [push] concurrency: 'true' jobs: Build: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-pc-windows-gnu + archive: zip + - target: x86_64-unknown-linux-musl + archive: tar.gz tar.xz tar.zst + - target: x86_64-apple-darwin + archive: zip steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install dependencies - run: npm ci - - name: Building project - run: npm run build - - name: Creating Linux Archive - uses: vimtor/action-zip@v1.1 + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@v1.4.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - files: out/kr-linux - dest: linux.zip - - name: Upload Linux Archive - uses: actions/upload-artifact@v3 - with: - path: linux.zip - - name: Creating MacOS Archive - uses: vimtor/action-zip@v1.1 - with: - files: out/kr-macos - dest: macos.zip - - name: Upload MacOS Archive - uses: actions/upload-artifact@v3 - with: - path: macos.zip - - name: Creating Windows Archive - uses: vimtor/action-zip@v1.1 - with: - files: out/kr-win.exe - dest: windows.zip - - name: Upload Windows Archive - uses: actions/upload-artifact@v3 - with: - path: windows.zip + RUSTTARGET: ${{ matrix.target }} + ARCHIVE_TYPES: ${{ matrix.archive }}