Release #41
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 | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
version: ${{ env.GitBuildVersionSimple }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '9.0.x' | |
- name: Nerdbank.GitVersioning | |
uses: dotnet/nbgv@master | |
with: | |
setCommonVars: true | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ env.GitBuildVersionSimple }} | |
tag_name: ${{ env.GitBuildVersionSimple }} | |
body_path: CHANGELOG.md | |
files: | | |
CHANGELOG.md | |
LICENSE | |
windows: | |
needs: release | |
runs-on: windows-latest | |
steps: | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
run: dotnet build GithubBackup.sln --configuration Release --no-restore | |
- name: Test | |
run: dotnet test GithubBackup.sln --configuration Release --no-restore | |
- name: Publish | |
run: | | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/win-x64 --runtime win-x64 | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/win-x86 --runtime win-x86 | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/win-arm64 --runtime win-arm64 | |
- name: Zip | |
run: | | |
Compress-Archive -Path ./publish/win-x64/* -DestinationPath ./publish/ghb_win_x64_${{ needs.release.outputs.version }}.zip | |
Compress-Archive -Path ./publish/win-x86/* -DestinationPath ./publish/ghb_win_x86_${{ needs.release.outputs.version }}.zip | |
Compress-Archive -Path ./publish/win-arm64/* -DestinationPath ./publish/ghb_win_arm64_${{ needs.release.outputs.version }}.zip | |
- name: Upload Release Assets | |
id: upload_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ needs.release.outputs.version }} | |
tag_name: ${{ needs.release.outputs.version }} | |
fail_on_unmatched_files: true | |
files: | | |
./publish/ghb_win_x64_${{ needs.release.outputs.version }}.zip | |
./publish/ghb_win_x86_${{ needs.release.outputs.version }}.zip | |
./publish/ghb_win_arm64_${{ needs.release.outputs.version }}.zip | |
linux: | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
run: dotnet build GithubBackup.sln --configuration Release --no-restore | |
- name: Test | |
run: dotnet test GithubBackup.sln --configuration Release --no-restore | |
- name: Publish | |
run: | | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/linux-x64 --runtime linux-x64 | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/linux-musl-x64 --runtime linux-musl-x64 | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/linux-musl-arm64 --runtime linux-musl-arm64 | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/linux-arm --runtime linux-arm | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/linux-arm64 --runtime linux-arm64 | |
- name: Zip | |
run: | | |
(cd linux-x64 && zip -r ../linux-x64/ghb_linux_x64_${{ needs.release.outputs.version }}.zip .) | |
(cd linux-musl-x64 && zip -r ../linux-musl-x64/ghb_linux_musl_x64_${{ needs.release.outputs.version }}.zip .) | |
(cd linux-musl-arm64 && zip -r ../linux-musl-arm64/ghb_linux_musl_arm64_${{ needs.release.outputs.version }}.zip .) | |
(cd linux-arm && zip -r ../linux-arm/ghb_linux_arm_${{ needs.release.outputs.version }}.zip .) | |
(cd linux-arm64 && zip -r ../linux-arm64/ghb_linux_arm64_${{ needs.release.outputs.version }}.zip .) | |
working-directory: ./publish/ | |
- name: Upload Release Assets | |
id: upload_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ needs.release.outputs.version }} | |
tag_name: ${{ needs.release.outputs.version }} | |
fail_on_unmatched_files: true | |
files: | | |
./publish/linux-x64/ghb_linux_x64_${{ needs.release.outputs.version }}.zip | |
./publish/linux-musl-x64/ghb_linux_musl_x64_${{ needs.release.outputs.version }}.zip | |
./publish/linux-musl-arm64/ghb_linux_musl_arm64_${{ needs.release.outputs.version }}.zip | |
./publish/linux-arm/ghb_linux_arm_${{ needs.release.outputs.version }}.zip | |
./publish/linux-arm64/ghb_linux_arm64_${{ needs.release.outputs.version }}.zip | |
macos: | |
needs: release | |
runs-on: macos-latest | |
steps: | |
- name: Restore | |
run: dotnet restore | |
- name: Build | |
run: dotnet build GithubBackup.sln --configuration Release --no-restore | |
- name: Test | |
run: dotnet test GithubBackup.sln --configuration Release --no-restore | |
- name: Publish | |
run: | | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/osx-x64 --runtime osx-x64 | |
dotnet publish GithubBackup.Cli/GithubBackup.Cli.csproj --configuration Release --output publish/osx-arm64 --runtime osx-arm64 | |
- name: Zip | |
run: | | |
(cd osx-x64 && zip -r ../osx-x64/ghb_osx_x64_${{ needs.release.outputs.version }}.zip .) | |
(cd osx-arm64 && zip -r ../osx-arm64/ghb_osx_arm64_${{ needs.release.outputs.version }}.zip .) | |
working-directory: ./publish/ | |
- name: Upload Release Assets | |
id: upload_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ needs.release.outputs.version }} | |
tag_name: ${{ needs.release.outputs.version }} | |
fail_on_unmatched_files: true | |
files: | | |
./publish/osx-x64/ghb_osx_x64_${{ needs.release.outputs.version }}.zip | |
./publish/osx-arm64/ghb_osx_arm64_${{ needs.release.outputs.version }}.zip |