From f1566b4560449f6f183ab00eeb4449d4f92db3de Mon Sep 17 00:00:00 2001 From: RobbyV2 Date: Thu, 21 Nov 2024 17:30:30 -0600 Subject: [PATCH] GH Actions Test --- .github/workflows/build.yml | 83 ++++++++++++++++++++++++++++++++----- readme.md | 2 +- 2 files changed, 73 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0eeff5f..2a2e364 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,10 +59,26 @@ jobs: mkdir -p release if [ "${{ matrix.target }}" = "x86_64-pc-windows-gnu" ]; then cp target/${{ matrix.target }}/release/fplc.exe release/fplc-x64.exe + mkdir -p installer + cp release/fplc-x64.exe installer/fplc.exe + cp LICENSE installer/ + cp assets/Pseudolang-Logo.ico installer/ else cp target/${{ matrix.target }}/release/fplc release/fplc-linux-x64 chmod +x release/fplc-linux-x64 - fi + + - name: Install NSIS + if: matrix.target == 'x86_64-pc-windows-gnu' + run: | + sudo apt-get update + sudo apt-get install -y nsis + + - name: Build Windows Installer + if: matrix.target == 'x86_64-pc-windows-gnu' + run: | + mkdir -p release/installer + makensis installer/pseudolang.nsi + cp release/installer/pseudolang-setup-x64.exe release/ - name: Upload Artifacts uses: actions/upload-artifact@v3 @@ -71,8 +87,16 @@ jobs: path: release/* retention-days: 7 + - name: Upload Installer Artifact + if: matrix.target == 'x86_64-pc-windows-gnu' + uses: actions/upload-artifact@v3 + with: + name: pseudolang-installer + path: release/installer/pseudolang-setup-x64.exe + retention-days: 7 + publish: - name: Publish Artifacts + name: Publish Release needs: build runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/main' @@ -85,14 +109,51 @@ jobs: with: path: artifacts - - name: Create Release Directory + - name: Prepare Release Files run: | - mkdir -p final_release - cp -r artifacts/*/* final_release/ - - - name: Upload Release Artifacts - uses: actions/upload-artifact@v3 + mkdir -p release + cp artifacts/pseudolang-x86_64-pc-windows-gnu/fplc-x64.exe release/ + cp artifacts/pseudolang-x86_64-pc-windows-gnu/pseudolang-setup-x64.exe release/ + cp artifacts/pseudolang-x86_64-unknown-linux-gnu/fplc-linux-x64 release/ + chmod +x release/fplc-linux-x64 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ github.run_number }} + release_name: Release v${{ github.run_number }} + draft: false + prerelease: false + + - name: Upload Release Assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./release/fplc-x64.exe + asset_name: fplc-x64.exe + asset_content_type: application/octet-stream + + - name: Upload Installer Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./release/pseudolang-setup-x64.exe + asset_name: pseudolang-setup-x64.exe + asset_content_type: application/octet-stream + + - name: Upload Linux Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: pseudolang-all-platforms - path: final_release/* - retention-days: 30 \ No newline at end of file + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./release/fplc-linux-x64 + asset_name: fplc-linux-x64 + asset_content_type: application/octet-stream \ No newline at end of file diff --git a/readme.md b/readme.md index 9d2b0c7..6b70b07 100644 --- a/readme.md +++ b/readme.md @@ -48,7 +48,7 @@ In order to compile the project yourself, you will need to have rust installed. [Pseudolang.md](Pseudolang.md) contains a full explanation of Pseudolang and features specific to PseudoLang. -The file `src/tests/mod.rs`, as it contains various unit tests for Pseudolang. +The file `src/tests/mod.rs` also contains various unit tests (examples of code) for Pseudolang. ## Todo