Update to 0.2.0-alpha.6 #19
Workflow file for this run
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 | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
# pull_request: | |
# branches: | |
# - 'master' | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: [windows-latest] | |
permissions: | |
contents: write | |
discussions: write | |
strategy: | |
matrix: | |
architecture: | |
- win-x64 | |
- win-arm64 | |
- linux-x64 | |
- linux-arm64 | |
env: | |
release: 'fnorm-${{ github.ref_name }}-${{ matrix.architecture }}' | |
release-directory: '${{ github.workspace }}/pub/${{ matrix.architecture }}' | |
archive-directory: '${{ github.workspace }}/archives' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.0.x' | |
- name: Create an archive directory | |
run: mkdir -p ${{ env.archive-directory }} | |
- name: Publish ${{ matrix.architecture }} (Windows) | |
if: matrix.architecture == 'win-x64' || matrix.architecture == 'win-arm64' | |
run: dotnet publish ./src/FixNormalization -c Release -o ${{ env.release-directory }} -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 ${{ env.release-directory }} -r ${{ matrix.architecture }} --self-contained -v normal | |
- name: Remove Unnecessary Files | |
run: | | |
pushd | |
cd ${{ github.workspace }}/pub/${{ matrix.architecture }} | |
Get-ChildItem -Filter *.pdb | Remove-Item -Force | |
Get-ChildItem -Filter *.deps.json -Recurse | Remove-Item | |
popd | |
- name: Copy README and LICENSE | |
run: cp ${{ github.workspace }}/README.md ${{ env.release-directory }} && cp ${{ github.workspace }}/LICENSE ${{ env.release-directory }} | |
- name: Create Archives | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: '${{ env.release }}.zip' | |
directory: ${{ env.archive-directory }} | |
path: ${{ env.release-directory }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.release }}-binary | |
path: ${{ env.archive-directory }}/${{ env.release }}.zip | |
overwrite: true | |
create-release: | |
name: Create Release on GitHub | |
needs: [publish] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
discussions: write | |
env: | |
blobs: '${{ github.workspace }}/blobs' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: '*-binary' | |
path: ${{ env.blobs }} | |
merge-multiple: true | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
${{ env.blobs }}/* | |
make_latest: ${{ !contains(github.ref_name, '-') }} | |
prerelease: ${{ contains(github.ref_name, '-') }} |