From 4234e1f8a8442587790e88900ba4c213bf38ab16 Mon Sep 17 00:00:00 2001 From: FernTheDev <15272073+Fernthedev@users.noreply.github.com> Date: Wed, 20 Dec 2023 20:02:08 -0400 Subject: [PATCH] Improve CI --- .github/workflows/cargo-build.yml | 22 ++++++++++ .github/workflows/cargo-release.yml | 37 ++++++++++++++++- .github/workflows/windows-installer.yml | 55 ------------------------- 3 files changed, 57 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/windows-installer.yml diff --git a/.github/workflows/cargo-build.yml b/.github/workflows/cargo-build.yml index 79d5e1a..302a64d 100644 --- a/.github/workflows/cargo-build.yml +++ b/.github/workflows/cargo-build.yml @@ -64,6 +64,28 @@ jobs: command: build args: --release + - name: Download Inno Setup + uses: suisei-cn/actions-download-file@v1 + if: ${{matrix.os == 'windows-latest' }} + with: + url: https://jrsoftware.org/download.php/is.exe + target: ../ + + - name: Install Inno Setup + if: ${{matrix.os == 'windows-latest' }} + run: "../is.exe /VERYSILENT /NORESTART /ALLUSERS" + + - name: Compile Installer + if: ${{matrix.os == 'windows-latest' }} + run: '& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /f installer/installer.iss' + + - name: Artifact Upload + uses: actions/upload-artifact@v2 + if: ${{matrix.os == 'windows-latest' }} + with: + name: qpm-installer.exe + path: ./installer/qpm-installer.exe + - name: Upload executable uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/cargo-release.yml b/.github/workflows/cargo-release.yml index d9aa939..abb2bb6 100644 --- a/.github/workflows/cargo-release.yml +++ b/.github/workflows/cargo-release.yml @@ -57,9 +57,42 @@ jobs: command: build args: --release + - name: Rename build + run: | + pwsh Compress-Archive ./target/release/${{matrix.file-name}} -DestinationPath qpm-${{matrix.prefix}}.zip + - name: Upload Release Assets - if: ${{ github.event_name != 'workflow_dispatch' }} uses: softprops/action-gh-release@v1 with: files: | - ./target/release/${{ matrix.file-name }} + qpm-${{matrix.prefix}}.zip + + # TODO: Move to somewhere else + - name: Download Inno Setup + uses: suisei-cn/actions-download-file@v1 + if: ${{matrix.os == 'windows-latest' }} + with: + url: https://jrsoftware.org/download.php/is.exe + target: ../ + + - name: Install Inno Setup + if: ${{matrix.os == 'windows-latest' }} + run: "../is.exe /VERYSILENT /NORESTART /ALLUSERS" + + - name: Compile Installer + if: ${{matrix.os == 'windows-latest' }} + run: '& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /f installer/installer.iss' + + - name: Artifact Upload + uses: actions/upload-artifact@v2 + if: ${{matrix.os == 'windows-latest' }} + with: + name: qpm-installer.exe + path: ./installer/qpm-installer.exe + + - name: Upload Installer Assets + if: ${{matrix.os == 'windows-latest' }} + uses: softprops/action-gh-release@v1 + with: + files: | + qpm-installer.exe \ No newline at end of file diff --git a/.github/workflows/windows-installer.yml b/.github/workflows/windows-installer.yml deleted file mode 100644 index caa5822..0000000 --- a/.github/workflows/windows-installer.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Windows Installer - -on: - push: - branches: [main] - paths-ignore: - - "README.md" - - "**.json" - - "**.yml" - - "LICENSE" - - "!.github/workflows/windows-installer.yml" - -jobs: - build: - name: Build installer on windows - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Download Inno Setup - uses: suisei-cn/actions-download-file@v1 - with: - url: https://jrsoftware.org/download.php/is.exe - target: ../ - - - name: Install Inno Setup - run: "../is.exe /VERYSILENT /NORESTART /ALLUSERS" - - - name: Cargo build - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - - - name: Compile Installer - run: '& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /f installer/installer.iss' - - - name: Artifact Upload - uses: actions/upload-artifact@v2 - with: - name: qpm-installer.exe - path: ./installer/qpm-installer.exe