Skip to content

Commit

Permalink
fix: Update archive and upload steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Capella87 committed Nov 26, 2024
1 parent 469c58f commit f91fc01
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,29 @@ jobs:

- name: Publish ${{ matrix.architecture }} (Windows)
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-arm64'
run: dotnet publish ./src/FixNormalization -c Release -o ./pub/${{ matrix.architecture }} -r ${{ matrix.architecture }} --no-self-contained -v normal
run: dotnet publish ./src/FixNormalization -c Release -o ${{ github.workspace }}/pub/${{ matrix.architecture }} -r ${{ matrix.architecture }} --no-self-contained -v normal

- name: Publish ${{ matrix.architecture }} (Others)
if: matrix.architecture != 'win-x64' && matrix.architecture != 'win-arm64'
run: dotnet publish ./src/FixNormalization -c Release -o ./pub/${{ matrix.architecture }} -r ${{ matrix.architecture }} --self-contained -v normal
run: dotnet publish ./src/FixNormalization -c Release -o ${{ github.workspace }}/pub/${{ matrix.architecture }} -r ${{ matrix.architecture }} --self-contained -v normal

- name: Remove unnecessary files
run: |
pushd
Set-Location -Path ./pub/${{ matrix.architecture }}
cd ${{ github.workspace }}/pub/${{ matrix.architecture }}
Get-ChildItem -Filter *.pdb | Remove-Item -Force
Get-ChildItem -Filter *.deps.json -Recurse | Remove-Item
Get-ChildItem -Filter *.runtimeconfig.json -Recurse | Remove-Item
popd
- name: Archive release ${{ env.release }}
uses: thedoctor0/zip-release@master
with:
filename: './${{ env.release }}.zip'
directory: './pub/${{ matrix.architecture }}'
- name: Upload release ${{ env.release }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.release }}-binary
path: ./${{ env.release }}.zip
name: binary-${{ env.release }}
path: ${{ github.workspace }}/pub/${{ matrix.architecture }}
compression-level: 6
overwrite: true

create-release:
name: Create Release on GitHub
needs: [publish]
Expand All @@ -63,12 +62,11 @@ jobs:
contents: write
discussions: write
steps:

- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: fnorm-${{ github.ref_name }}-*-binary
path: result
name: binary-*
path: ${{ github.workspace }}/result

- name: Release
uses: softprops/action-gh-release@v2
Expand All @@ -77,7 +75,7 @@ jobs:
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
files: |
result/*.zip
${{ github.workspace }}/result/*.zip
make_latest: ${{ !contains(github.ref_name, '-') }}
prerelease: ${{ contains(github.ref_name, '-') }}

Expand Down

0 comments on commit f91fc01

Please sign in to comment.