Skip to content

Release

Release #38

Workflow file for this run

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: 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:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- 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 win-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/ghb_win_x64_${{ needs.release.outputs.version }}.zip
asset_name: ghb_win_x64_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip
- name: Upload Release Assets win-x86
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/ghb_win_x86_${{ needs.release.outputs.version }}.zip
asset_name: ghb_win_x86_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip
- name: Upload Release Assets win-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/ghb_win_arm64_${{ needs.release.outputs.version }}.zip
asset_name: ghb_win_arm64_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip
linux:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- 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 linux-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/linux-x64/ghb_linux_x64_${{ needs.release.outputs.version }}.zip
asset_name: ghb_linux_x64_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip
- name: Upload Release Assets linux-musl-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/linux-musl-x64/ghb_linux_musl_x64_${{ needs.release.outputs.version }}.zip
asset_name: ghb_linux_musl_x64_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip
- name: Upload Release Assets linux-musl-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/linux-musl-arm64/ghb_linux_musl_arm64_${{ needs.release.outputs.version }}.zip
asset_name: ghb_linux_musl_arm64_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip
- name: Upload Release Assets linux-arm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/linux-arm/ghb_linux_arm_${{ needs.release.outputs.version }}.zip
asset_name: ghb_linux_arm_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip
- name: Upload Release Assets linux-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/linux-arm64/ghb_linux_arm64_${{ needs.release.outputs.version }}.zip
asset_name: ghb_linux_arm64_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip
macos:
needs: release
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- 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 osx-x64
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 osx-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/osx-x64/ghb_osx_x64_${{ needs.release.outputs.version }}.zip
asset_name: ghb_osx_x64_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip
- name: Upload Release Assets osx-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./publish/osx-arm64/ghb_osx_arm64_${{ needs.release.outputs.version }}.zip
asset_name: ghb_osx_arm64_${{ needs.release.outputs.version }}.zip
asset_content_type: application/zip