mirror of
https://github.com/AdvDebug/Brovan
synced 2026-08-09 11:57:17 +00:00
Allow people to download artifacts
This commit is contained in:
@@ -4,6 +4,8 @@ on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ main ]
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -17,10 +19,12 @@ jobs:
|
||||
- platform: Windows x64
|
||||
runner: windows-latest
|
||||
rid: win-x64
|
||||
archive_ext: zip
|
||||
|
||||
- platform: Linux x64
|
||||
runner: ubuntu-latest
|
||||
rid: linux-x64
|
||||
archive_ext: tar.gz
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -35,10 +39,47 @@ jobs:
|
||||
run: dotnet restore Brovan/Brovan.csproj
|
||||
|
||||
- name: Publish
|
||||
run: dotnet publish Brovan/Brovan.csproj -c Release -r ${{ matrix.rid }} --self-contained false -o artifacts
|
||||
run: dotnet publish Brovan/Brovan.csproj -c Release -r ${{ matrix.rid }} --self-contained false -o artifacts/publish/${{ matrix.rid }}
|
||||
|
||||
- name: Upload Artifacts
|
||||
- name: Package Windows artifact
|
||||
if: runner.os == 'Windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
New-Item -ItemType Directory -Force -Path artifacts/packages | Out-Null
|
||||
Compress-Archive -Path "artifacts/publish/${{ matrix.rid }}/*" -DestinationPath "artifacts/packages/Brovan-${{ matrix.rid }}.zip"
|
||||
|
||||
- name: Package Linux artifact
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p artifacts/packages
|
||||
tar -C "artifacts/publish/${{ matrix.rid }}" -czf "artifacts/packages/Brovan-${{ matrix.rid }}.tar.gz" .
|
||||
|
||||
- name: Upload CI Artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: Brovan ${{ matrix.platform }}
|
||||
path: artifacts/**
|
||||
path: artifacts/packages/*
|
||||
retention-days: 14
|
||||
|
||||
release:
|
||||
name: Publish GitHub Release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
path: release-artifacts
|
||||
|
||||
- name: Create GitHub Release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh release create "${{ github.ref_name }}" release-artifacts/**/*
|
||||
--title "${{ github.ref_name }}"
|
||||
--generate-notes
|
||||
|
||||
Reference in New Issue
Block a user