Skip to content

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidxuang committed Nov 24, 2023
1 parent 5c08bd4 commit 71f868c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 5 deletions.
47 changes: 43 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:
run: |
tar cavf musicdecrypto-all-$GIT_TAG_NAME-net7.0-noarch.tar.xz -C ./generic/ $(cd ./generic/ && echo *)
sha256sum musicdecrypto-all-$GIT_TAG_NAME-net7.0-noarch.tar.xz > musicdecrypto-all-$GIT_TAG_NAME-net7.0-noarch.tar.xz.sha256
strip ./cli-x64/musicdecrypto
aarch64-linux-gnu-strip ./cli-arm64/musicdecrypto
tar cavf musicdecrypto-gui-$GIT_TAG_NAME-linux-x64.tar.xz -C ./gui-x64/ $(cd ./gui-x64/ && echo *)
tar cavf musicdecrypto-gui-$GIT_TAG_NAME-linux-arm64.tar.xz -C ./gui-arm64/ $(cd ./gui-arm64/ && echo *)
tar cavf musicdecrypto-cli-$GIT_TAG_NAME-linux-x64.tar.xz -C ./cli-x64/ musicdecrypto
Expand All @@ -56,8 +54,8 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
musicdecrypto-all-${{ steps.tag.outputs.tag }}-net7.0-noarch.tar.xz
musicdecrypto-all-${{ steps.tag.outputs.tag }}-net7.0-noarch.tar.xz.sha256
musicdecrypto-all-${{ steps.tag.outputs.tag }}-net8.0-noarch.tar.xz
musicdecrypto-all-${{ steps.tag.outputs.tag }}-net8.0-noarch.tar.xz.sha256
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-linux-x64.tar.xz
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-linux-x64.tar.xz.sha256
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-linux-arm64.tar.xz
Expand All @@ -66,6 +64,47 @@ jobs:
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-linux-x64.tar.xz.sha256
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-linux-arm64.tar.xz
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-linux-arm64.tar.xz.sha256
macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Publish Avalonia
run: |
dotnet publish MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj -c Release -r osx-x64 --sc -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=partial -o ./gui-x64
dotnet publish MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj -c Release -r osx-arm64 --sc -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=partial -o ./gui-arm64
- name: Publish CLI
run: |
dotnet publish MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj -c Release -r osx-x64 -o ./cli-x64
dotnet publish MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj -c Release -r osx-arm64 -o ./cli-arm64
- name: Extract tag name
id: tag
if: startsWith(github.ref, 'refs/tags/')
uses: olegtarasov/get-tag@v2.1.2
- name: Pack
if: startsWith(github.ref, 'refs/tags/')
run: |
tar cavf musicdecrypto-gui-$GIT_TAG_NAME-osx-x64.tar.xz -C ./gui-x64/ $(cd ./gui-x64/ && echo *)
tar cavf musicdecrypto-gui-$GIT_TAG_NAME-osx-arm64.tar.xz -C ./gui-arm64/ $(cd ./gui-arm64/ && echo *)
tar cavf musicdecrypto-cli-$GIT_TAG_NAME-osx-x64.tar.xz -C ./cli-x64/ musicdecrypto
tar cavf musicdecrypto-cli-$GIT_TAG_NAME-osx-arm64.tar.xz -C ./cli-arm64/ musicdecrypto
sha256sum musicdecrypto-gui-$GIT_TAG_NAME-osx-x64.tar.xz > musicdecrypto-gui-$GIT_TAG_NAME-osx-x64.tar.xz.sha256
sha256sum musicdecrypto-gui-$GIT_TAG_NAME-osx-arm64.tar.xz > musicdecrypto-gui-$GIT_TAG_NAME-osx-arm64.tar.xz.sha256
sha256sum musicdecrypto-cli-$GIT_TAG_NAME-osx-x64.tar.xz > musicdecrypto-cli-$GIT_TAG_NAME-osx-x64.tar.xz.sha256
sha256sum musicdecrypto-cli-$GIT_TAG_NAME-osx-arm64.tar.xz > musicdecrypto-cli-$GIT_TAG_NAME-osx-arm64.tar.xz.sha256
- name: GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-osx-x64.tar.xz
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-osx-x64.tar.xz.sha256
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-osx-arm64.tar.xz
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-osx-arm64.tar.xz.sha256
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-osx-x64.tar.xz
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-osx-x64.tar.xz.sha256
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-osx-arm64.tar.xz
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-osx-arm64.tar.xz.sha256
win:
runs-on: windows-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>None</DebugType>
<PublishAot>true</PublishAot>
<!-- <StripSymbols>true</StripSymbols> -->
<StripSymbols>true</StripSymbols>
<InvariantGlobalization>true</InvariantGlobalization>
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
</PropertyGroup>
Expand Down

0 comments on commit 71f868c

Please sign in to comment.