Skip to content

Commit

Permalink
Update package-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sn4k3 committed Aug 13, 2023
1 parent 7f97afa commit 870d747
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/package-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,34 @@ jobs:
publish:
name: Publish for ${{ matrix.os_identifier }}
runs-on: ${{ matrix.os }}
env:
os_identifier: ${{ matrix.os_identifier }}
publish_folder: "SpeciesDatabaseCmd_$os_identifier_${{ github.ref_name }}"
artifact_name: "$publish_folder.zip"
strategy:
matrix:
include:
- os: ubuntu-latest
os_identifier: linux-x64
publish_folder: "SpeciesDatabaseCmd_linux-x64_${{ github.ref_name }}"
artifact_name: "SpeciesDatabaseCmd_linux-x64_${{ github.ref_name }}.zip"

- os: windows-latest
os_identifier: win-x64

publish_folder: "SpeciesDatabaseCmd_win-x64_${{ github.ref_name }}"
artifact_name: "SpeciesDatabaseCmd_win-x64_${{ github.ref_name }}.zip"

- os: macos-latest
os_identifier: osx-x64
publish_folder: "SpeciesDatabaseCmd_osx-x64_${{ github.ref_name }}"
artifact_name: "SpeciesDatabaseCmd_osx-x64_${{ github.ref_name }}.zip"

- os: macos-latest
os_identifier: osx-arm64
publish_folder: "SpeciesDatabaseCmd_osx-arm64_${{ github.ref_name }}"
artifact_name: "SpeciesDatabaseCmd_osx-arm64_${{ github.ref_name }}.zip"

steps:
- name: 🛒 Checkout
uses: actions/checkout@v3

- name: Verify commit exists in origin/master
- name: 🔍 Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
Expand All @@ -71,19 +75,19 @@ jobs:

- name: 🔧 Build
run: |
dotnet publish SpeciesDatabaseCmd -o $publish_folder -c Release -r $os_identifier -p:PublishReadyToRun=true --self-contained
dotnet publish SpeciesDatabaseCmd -o ${{ matrix.publish_folder }} -c Release -r ${{ matrix.os_identifier }} -p:PublishReadyToRun=true --self-contained
- name: 📦 Zip
uses: vimtor/action-zip@v1
with:
files: ${publish_folder}/
files: ${{ matrix.publish_folder }}/
recursive: true
dest: ${artifact_name}
dest: ${{ matrix.artifact_name }}

- name: 🚀 Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: $artifact_name
asset_name: $artifact_name
file: ${{ matrix.artifact_name }}
asset_name: ${{ matrix.artifact_name }}
tag: ${{ github.ref }}

0 comments on commit 870d747

Please sign in to comment.