CI: publish binaries as artifact and release (#2) #43
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: Build | |
on: [push, pull_request] | |
jobs: | |
build-dotnetrgs-server: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore ./DotNetRGS.Server/DotNetRGS.Server.fsproj | |
- name: Build | |
run: dotnet build ./DotNetRGS.Server/DotNetRGS.Server.fsproj --no-restore | |
build-dotnetrgs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: install missing dependencies | |
run: sudo apt install --yes fsharp | |
- name: install last version of mono (Microsoft APT repositories) | |
run: sudo ./scripts/install_mono_from_microsoft_deb_packages.sh | |
- name: check mono version | |
run: mono --version | |
- name: Build geewallet | |
run: | | |
cd geewallet | |
./configure.sh | |
make release | |
- uses: nuget/setup-nuget@v1 | |
with: | |
nuget-version: '6.5.0' | |
- name: Restore dependencies | |
run: nuget restore ./DotNetRGS/DotNetRGS.fsproj | |
- name: Build | |
run: msbuild ./DotNetRGS/DotNetRGS.fsproj /p:Configuration=Release | |
- name: Archive the build output | |
run: | | |
sudo apt install --yes zip | |
cd DotNetRGS/bin/Release/net472 | |
zip -r dotnet-rgs-server.zip * | |
# is this needed? | |
cd ../../../../ | |
- name: Upload as build artifact | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: dotnet-rgs-server.zip | |
path: DotNetRGS/bin/Release/net472/dotnet-rgs-server.zip | |
- name: Create Release | |
id: create_release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: DotNetRGS | |
draft: false | |
prerelease: true | |
- name: Upload Server As Release Asset | |
id: upload-server-asset | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./DotNetRGS/bin/Release/net472/dotnet-rgs-server.zip | |
asset_name: dotnet-rgs-server.zip | |
asset_content_type: application/zip |