Update release.yml
Fabio Cevasco h3rald@h3rald.com
Thu, 01 Apr 2021 11:18:43 +0200
1 files changed,
16 insertions(+),
32 deletions(-)
jump to
M
.github/workflows/release.yml
→
.github/workflows/release.yml
@@ -30,6 +30,10 @@ - name: "Cancel similar actions in progress"
uses: styfle/cancel-workflow-action@0.6.0 with: access_token: ${{ github.token }} + + - name: Detect current OS + id: os + run: echo "::set-output name=id::${{matrix.os == 'ubuntu-latest' && 'linux' || matrix.os == 'macos-latest' && 'macosx' || matrix.os == 'windows-latest' && 'windows'}}" # Checks out the repository - uses: actions/checkout@v2@@ -60,39 +64,9 @@ run: nim c -d:release --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --gc:orc --deepcopy:on --opt:size mn
if: matrix.os == 'ubuntu-latest' # Build for MacOS - - name: Build (MacOS) - run: nim c -d:release --gc:orc --deepcopy:on --opt:size mn - if: matrix.os == 'macos-latest' - - # Build for Windows - - name: Build (Windows) + - name: Build (MacOS, Windows) run: nim c -d:release --gc:orc --deepcopy:on --opt:size mn - if: matrix.os == 'windows-latest' - - - name: Get Version (Linux, MacOS) - id: version-nix - run: echo "::set-output name=id::$(./mn mntool info:version)" - if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' - - - name: Get Version (Windows) - id: version-win - run: echo "::set-output name=id::$(.\mn.exe mntool info:version)" - if: matrix.os == 'windows-latest' - - # Package the resulting Linux binary - - name: Create artifact (Linux) - run: zip mn_v${{steps.version-nix.outputs.id}}_linux_x64.zip mn - if: matrix.os == 'ubuntu-latest' - - # Package the resulting MacOS binary - - name: Create artifact (MacOS) - run: zip mn_v${{steps.version-nix.outputs.id}}_macosx_x64.zip mn - if: matrix.os == 'macos-latest' - - # Package the resulting Windows binary - - name: Create artifact (Windows) - run: Compress-Archive -Path mn.exe -DestinationPath mn_v${{steps.version-win.outputs.id}}_windows_x64.zip - if: matrix.os == 'windows-latest' + if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest' - name: "Get current release" id: current-release@@ -101,6 +75,16 @@ with:
myToken: ${{ github.token }} exclude_types: "release" view_top: 1 + + # Package the resulting Linux/MacOS binary + - name: Create artifact (Linux, MacOS) + run: zip mn_${{steps.current-release.outputs.name }}_${{steps.os.outputs.id}}_x64.zip mn + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + + # Package the resulting Windows binary + - name: Create artifact (Windows) + run: Compress-Archive -Path mn.exe -DestinationPath mn_v${{steps.version-win.outputs.id}}_windows_x64.zip + if: matrix.os == 'windows-latest' # Upload artifacts - name: "Upload to release"