Skip to content

Commit

Permalink
GH Actions Test
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbyV2 committed Nov 21, 2024
1 parent 2341edf commit f1566b4
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 12 deletions.
83 changes: 72 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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
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
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f1566b4

Please sign in to comment.