Update dotnet-publish.yml #16
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: .NET | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '8.0.x' # 使用する.NETのバージョン | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Get the version | |
id: get_version | |
run: | | |
VERSION=$(grep '<Version>' git-local-repository-listing/git-local-repository-listing.csproj | head -1 | awk -F'[<>]' '{print $3}') | |
echo "Version: $VERSION" | |
echo "::set-output name=VERSION::$VERSION" | |
shell: bash | |
- name: Publish Runtime Dependent Any | |
run: | | |
dotnet publish git-local-repository-listing/git-local-repository-listing.csproj --configuration Release --output publish/runtime-dependent-any --self-contained false -p:PublishSingleFile=false | |
cd publish/runtime-dependent-any | |
zip -r lepol-any-runtime-dependent-${{ steps.get_version.outputs.VERSION }}.zip . | |
cd ../.. | |
zip -j lepol-any-runtime-dependent-${{ steps.get_version.outputs.VERSION }}.zip src/lepos.bash | |
- name: Publish Windows Runtime Dependent | |
run: | | |
dotnet publish git-local-repository-listing/git-local-repository-listing.csproj --configuration Release --output publish/windows-runtime-dependent --runtime win-x64 --self-contained false | |
zip -r -j lepol-windows-runtime-dependent-${{ steps.get_version.outputs.VERSION }}.zip publish/windows-runtime-dependent src/lepos.bash | |
- name: Publish Windows Self-Contained | |
run: | | |
dotnet publish git-local-repository-listing/git-local-repository-listing.csproj --configuration Release --output publish/windows-self-contained --runtime win-x64 --self-contained true | |
zip -r -j lepol-windows-self-contained-${{ steps.get_version.outputs.VERSION }}.zip publish/windows-self-contained src/lepos.bash | |
- name: Publish Linux Runtime Dependent | |
run: | | |
dotnet publish git-local-repository-listing/git-local-repository-listing.csproj --configuration Release --output publish/linux-runtime-dependent --runtime linux-x64 --self-contained false | |
zip -r -j lepol-linux-runtime-dependent-${{ steps.get_version.outputs.VERSION }}.zip publish/linux-runtime-dependent src/lepos.bash | |
- name: Publish Linux Self-Contained | |
run: | | |
dotnet publish git-local-repository-listing/git-local-repository-listing.csproj --configuration Release --output publish/linux-self-contained --runtime linux-x64 --self-contained true | |
zip -r -j lepol-linux-self-contained-${{ steps.get_version.outputs.VERSION }}.zip publish/linux-self-contained src/lepos.bash | |
- name: Release with action-gh-release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
lepol-any-runtime-dependent-${{ steps.get_version.outputs.VERSION }}.zip | |
lepol-windows-runtime-dependent-${{ steps.get_version.outputs.VERSION }}.zip | |
lepol-windows-self-contained-${{ steps.get_version.outputs.VERSION }}.zip | |
lepol-linux-runtime-dependent-${{ steps.get_version.outputs.VERSION }}.zip | |
lepol-linux-self-contained-${{ steps.get_version.outputs.VERSION }}.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: v${{ steps.get_version.outputs.VERSION }} | |
name: Release v${{ steps.get_version.outputs.VERSION }} | |
draft: false | |
prerelease: false |