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 assets | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
publish: | |
name: Publish for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
runtime: linux-x64 | |
artifact_name: pwsafe | |
asset_name: pwsafe-linux-amd64 | |
- os: windows-latest | |
runtime: win-x64 | |
artifact_name: pwsafe.exe | |
asset_name: pwsafe-windows-amd64 | |
- os: macos-latest | |
runtime: osx-x64 | |
artifact_name: pwsafe | |
asset_name: pwsafe-macos-amd64 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Extract Version | |
working-directory: . | |
if: ${{ runner.os == 'Windows' }} | |
run: | | |
$version = .\build\extract_version.ps1 "${GITHUB_REF#refs/tags/}" | |
echo "VERSION=$version" >> $env:GITHUB_ENV | |
- name: Extract Version | |
working-directory: . | |
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} | |
run: | | |
version=$(./build/extract_version.sh "${GITHUB_REF#refs/tags/}") | |
echo "VERSION=$version" >> $GITHUB_ENV | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Bundle exe | |
run: >- | |
dotnet publish src/PwSafeClient.CLI -c Release -r ${{ matrix.runtime }} --self-contained true -p:PackageVersion=$VERSION -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishTrimmed=True -o release | |
env: | |
Runtime: | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: release/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} |