CentCom 1.7.3 #8
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: release | |
on: | |
release: | |
types: [created] | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.305 | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Prepare publish artifacts | |
run: | | |
dotnet publish CentCom.API -o publish/linux-x64/CentCom.API/ -r "linux-x64" --self-contained false -c Release --nologo | |
7z a publish/CentCom.API-linux-x64.7z -r ./publish/linux-x64/CentCom.API/* | |
dotnet publish CentCom.Server -o publish/linux-x64/CentCom.Server -r "linux-x64" --self-contained false -c Release --nologo | |
7z a publish/CentCom.Server-linux-x64.7z -r ./publish/linux-x64/CentCom.Server/* | |
dotnet publish CentCom.Exporter -o publish/linux-x64/CentCom.Exporter -r "linux-x64" --self-contained false -c Release --nologo | |
7z a publish/CentCom.Exporter-linux-x64.7z -r ./publish/linux-x64/CentCom.Exporter/* | |
dotnet publish CentCom.API -o publish/win-x64/CentCom.API/ -r "win-x64" --self-contained false -c Release --nologo | |
7z a publish/CentCom.API-win-x64.7z -r ./publish/win-x64/CentCom.API/* | |
dotnet publish CentCom.Server -o publish/win-x64/CentCom.Server -r "win-x64" --self-contained false -c Release --nologo | |
7z a publish/CentCom.Server-win-x64.7z -r ./publish/win-x64/CentCom.Server/* | |
dotnet publish CentCom.Exporter -o publish/win-x64/CentCom.Exporter -r "win-x64" --self-contained false -c Release --nologo | |
7z a publish/CentCom.Exporter-win-x64.7z -r ./publish/win-x64/CentCom.Exporter/* | |
- name: Upload release artifacts | |
uses: actions/github-script@v4 | |
with: | |
script: | | |
const fs = require('fs'); | |
const tag = context.ref.replace("refs/tags/", ""); | |
console.log("tag = ", tag); | |
// Get release for this tag | |
const release = await github.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag | |
}); | |
const releaseRuntimes = ['linux-x64', 'win-x64']; | |
const projects = ['CentCom.API', 'CentCom.Server', 'CentCom.Exporter']; | |
for (rt of releaseRuntimes) { | |
for (proj of projects) { | |
// Upload the release asset | |
await github.repos.uploadReleaseAsset({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: release.data.id, | |
name: `${proj}-${rt}.7z`, | |
data: fs.readFileSync(`publish/${proj}-${rt}.7z`) | |
}); | |
} | |
} |