Cli #3
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: Cli | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
name: Release | |
strategy: | |
matrix: | |
kind: ['linux', 'linux-arm64', 'windows', 'windows-arm64', 'macOS', 'macOS-arm64'] | |
include: | |
- kind: linux | |
os: ubuntu-latest | |
target: linux-x64 | |
- kind: linux-arm64 | |
os: ubuntu-latest | |
target: linux-arm64 | |
- kind: windows | |
os: windows-latest | |
target: win-x64 | |
- kind: windows-arm64 | |
os: windows-latest | |
target: win-arm64 | |
- kind: macOS | |
os: macos-latest | |
target: osx-x64 | |
- kind: macOS-arm64 | |
os: macos-latest | |
target: osx-arm64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build | |
shell: bash | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
release_name="FonoSozlukCli-$tag-${{ matrix.target }}" | |
# Build everything | |
dotnet publish ./FonoSozlukNet/FonoSozlukCli/FonoSozlukCli.csproj -c:Release -r "${{ matrix.target }}" -o "$release_name" | |
# Pack files | |
if [[ "${{ matrix.target }}" == "win-x64" || "${{ matrix.target }}" == "win-arm64"]]; then | |
# Pack to zip for Windows | |
7z a -tzip "${release_name}.zip" "./${release_name}/*" | |
else | |
tar czvf "${release_name}.tar.gz" "$release_name" | |
fi | |
# Delete output directory | |
rm -r "$release_name" | |
- name: Publish | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: "FonoSozlukCli*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |