fixed blockers issues: #89, #90, #91, #92 #83
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and release application | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'app/**' | |
- 'lms-2024.sln' | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
target_platform: | |
- linux-x64 | |
- linux-arm | |
- linux-arm64 | |
- linux-musl-x64 | |
- linux-musl-arm64 | |
- linux-bionic-arm64 | |
- win-x64 | |
- win-arm64 | |
- osx-x64 | |
- osx-arm64 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/[email protected] | |
with: | |
dotnet-version: 8.0.402 | |
- name: Install dependencies | |
run: dotnet restore | |
working-directory: app | |
- name: Run tests | |
run: dotnet test | |
- name: Build | |
run: >- | |
dotnet publish app/ | |
-o ./publish/ | |
-c Release | |
--self-contained true | |
--runtime ${{ matrix.target_platform }} | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: lms-${{ matrix.target_platform }} | |
path: ./publish/ | |
release: | |
permissions: | |
packages: write | |
contents: write | |
needs: build | |
runs-on: ubuntu-latest | |
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: lms-* | |
merge-multiple: false | |
path: ./publish | |
- name: Zip all artifacts | |
run: | | |
mkdir -p ./release | |
for file in ./publish/*; do | |
zip -r9 ./release/$(basename $file).zip $file | |
done | |
- name: Create release | |
run: | | |
git_short_hash=$(git rev-parse --short "$GITHUB_SHA") | |
gh release create "prerelease-$git_short_hash" --latest=false --generate-notes -p -t "Pre Release $git_short_hash" ./release/*.zip | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |