Publish Release #8
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: Publish Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
name: 📪 Release | |
strategy: | |
matrix: | |
kind: ['linux', 'windows', 'macOS'] | |
include: | |
- kind: linux | |
os: ubuntu-latest | |
target: linux-x64 | |
- kind: windows | |
os: windows-latest | |
target: win-x64 | |
- kind: macOS | |
os: macos-latest | |
target: osx-x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Install dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.100-rc.1.23463.5 | |
- name: Build | |
shell: bash | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
release_name="gum-release-$tag-${{ matrix.target }}" | |
# Build everything | |
dotnet publish --runtime "${{ matrix.target }}" -c Release -o "$release_name" | |
# Pack files | |
if [ "${{ matrix.target }}" == "win-x64" ]; 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@v1 | |
with: | |
files: "gum-release*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
pack: | |
name: 📦 Pack and publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Install dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.100-rc.1.23463.5 | |
- name: Setup NuGet | |
uses: NuGet/[email protected] | |
- name: Pack and push | |
run: | | |
dotnet pack -c Release | |
dotnet nuget push ./src/Gum/bin/Release/Gum.*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${NUGET_TOKEN} | |
env: | |
NUGET_TOKEN: ${{secrets.NUGET_TOKEN}} |