Skip to content

Release

Release #61

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
confirmVersionIsSet:
description: 'Confirm version is set'
type: boolean
defaults:
run:
working-directory: src
jobs:
init:
uses: ./.github/workflows/init.yml
exe:
name: Build executables
runs-on: ubuntu-latest
needs: init
strategy:
matrix:
rid:
- win-x64
- win-arm64
- osx-x64
- osx-arm64
- linux-x64
- linux-arm64
- linux-musl-x64
- linux-musl-arm64
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x"
- name: Install dependencies
working-directory: src/Valleysoft.Dredge
run: dotnet restore --runtime ${{ matrix.rid }}
- name: Publish
working-directory: src/Valleysoft.Dredge
run: dotnet publish -f net8.0 -c Release --no-restore -o ${{ github.workspace }}/publish --runtime ${{ matrix.rid }}
- name: Rename output
run: |
if [[ "${{ matrix.rid }}" == *"win"* ]]; then
dredgeExt=".exe"
else
dredgeExt=""
fi
exeName="dredge-${{ needs.init.outputs.product-version }}-${{ matrix.rid }}${dredgeExt}"
echo "EXE_NAME=${exeName}" >> $GITHUB_ENV
mv ${{ github.workspace }}/publish/dredge${dredgeExt} ${{ github.workspace }}/publish/${exeName}
rm ${{ github.workspace }}/publish/dredge.pdb
- name: Generate checksum
run: sha256sum ${EXE_NAME} >${EXE_NAME}.sha256sum
working-directory: ${{ github.workspace }}/publish
- name: Save build binaries
uses: actions/upload-artifact@v3
with:
name: dredge-binaries-${{ matrix.rid }}
path: ${{ github.workspace }}/publish
save-exes:
name: Save executables
needs: exe
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download build binaries
uses: actions/download-artifact@v3
with:
path: ${{ github.workspace }}/publish
- name: Move all files
run: |
mv ${{ github.workspace }}/publish/dredge-binaries-*/* ${{ github.workspace }}/publish
rm -r ${{ github.workspace }}/publish/dredge-binaries-*
- name: Save build binaries
uses: actions/upload-artifact@v3
with:
name: dredge-binaries
path: ${{ github.workspace }}/publish
nuget:
name: Publish NuGet Package
runs-on: ubuntu-latest
needs: [ init, save-exes ]
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x"
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore Valleysoft.Dredge
- name: Pack
env:
PACKAGE_VERSION: ${{ needs.init.outputs.product-version }}
run: dotnet pack -c Release -p:Version=$PACKAGE_VERSION Valleysoft.Dredge -p:IsPack=true
# - name: Publish Package
# run: dotnet nuget push "Valleysoft.Dredge/bin/Release/*.nupkg" -k ${{secrets.NUGET_ORG_API_KEY}} -s https://nuget.org
docker:
uses: ./.github/workflows/docker-publish.yml
needs: [ nuget ]