forked from dmikushin/tray
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[force ci] CI, improve readme, add icon
Showing
4 changed files
with
222 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.*' | ||
|
||
jobs: | ||
meta: | ||
name: Get Metadata | ||
uses: StirlingLabs/Actions/.github/workflows/[email protected] | ||
|
||
build: | ||
name: Build & Test | ||
needs: [ meta ] | ||
uses: ./.github/workflows/integrate.yaml | ||
|
||
release: | ||
name: Create & Push NuPkg | ||
needs: [ meta, build ] | ||
strategy: | ||
fail-fast: true | ||
max-parallel: 1 | ||
matrix: | ||
include: | ||
- rid: linux-x64 | ||
name: Linux | ||
filename: ${{ needs.meta.outputs.linuxBaseName }} | ||
short_sha: ${{ needs.meta.outputs.short_sha }} | ||
- rid: osx | ||
name: macOS | ||
filename: ${{ needs.meta.outputs.macBaseName }} | ||
short_sha: ${{ needs.meta.outputs.short_sha }} | ||
- rid: win-x64 | ||
name: Windows | ||
filename: ${{ needs.meta.outputs.winBaseName }} | ||
short_sha: ${{ needs.meta.outputs.short_sha }} | ||
runs-on: ubuntu-22.04 | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
steps: | ||
|
||
- name: Download artifact | ||
id: download | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: libtray-${{ matrix.name }} | ||
|
||
- name: Download ancillary files | ||
id: ancillary | ||
env: | ||
rawUrl: 'https://raw.githubusercontent.com/StirlingLabs/tray/master' | ||
readmeFilename: README.md | ||
iconFilename: icon.png | ||
run: | | ||
readme="README.md" | ||
icon="icon.png" | ||
wget --output-document $readme ${rawUrl}/${readmeFilename} | ||
wget --output-document $icon ${rawUrl}/${iconFilename} | ||
echo "readme=$readme" >> $GITHUB_OUTPUT | ||
echo "icon=$icon" >> $GITHUB_OUTPUT | ||
- name: List Files | ||
run: | | ||
ls -laR | ||
- name: Rename Win DLL | ||
id: rename | ||
if: matrix.name == 'Windows' | ||
env: | ||
filename: ${{ matrix.filename }} | ||
run: | | ||
find . -maxdepth 1 -type f -name "*.dll" 2>/dev/null | wc -l | ||
dllCount=$(find . -maxdepth 1 -type f -name "*.dll") 2>/dev/null | ||
if [[ $dllCount -eq 1 ]] ; then | ||
mv ./*.dll $filename | ||
else | ||
echo "Could not rename DLL, since $dllCount files were identified." | ||
exit 1 | ||
fi | ||
ls -laR | ||
- name: Compute Values | ||
id: compute | ||
env: | ||
description: ${{ needs.meta.outputs.description }} | ||
rid: ${{ matrix.rid }} | ||
run: | | ||
prefixDesc="" | ||
if [ "$description" != "" ] ; then | ||
prefixDesc="${description}. " | ||
fi | ||
description="${prefixDesc}This package provides libraries for ${rid}." | ||
echo "Description is $description" | ||
echo "description=$description" >> "$GITHUB_OUTPUT" | ||
- name: Create NuSpec | ||
id: nuspec | ||
uses: StirlingLabs/[email protected] | ||
with: | ||
id: StirlingLabs.${{ needs.meta.outputs.coreName }}.native.${{ matrix.rid }} | ||
version: ${{ needs.meta.outputs.numericVersion }} | ||
title: ${{ needs.meta.outputs.project }} runtime for ${{ matrix.rid }} ${{ needs.meta.outputs.textVersion }} | ||
description: ${{ steps.compute.outputs.description }} | ||
authors: assimp Team, packaged by Stirling Labs | ||
fileSources: ${{ steps.download.outputs.download-path }}/${{ matrix.filename }} | ||
fileTargets: runtimes/${{ matrix.rid }}/native/${{ matrix.filename }} | ||
readme: ${{ steps.ancillary.outputs.readme }} | ||
icon: ${{ steps.ancillary.outputs.icon }} | ||
tags: SL StirlingLabs library | ||
license: BSD-3-Clause | ||
gitUrl: ${{ needs.meta.outputs.gitUrl }} | ||
gitBranch: ${{ needs.meta.outputs.currentBranch }} | ||
gitCommit: ${{ github.sha }} | ||
|
||
- name: Package Files | ||
env: | ||
nuspec: ${{ steps.nuspec.outputs.filename }} | ||
run: | | ||
nuget pack $nuspec | ||
ls -la | ||
- name: Push NuPkg | ||
env: | ||
preRelease: ${{ needs.meta.outputs.preRelease }} | ||
repoOwner: ${{ github.repository_owner }} | ||
run: | | ||
if [[ "$preRelease" == "true" ]] ; then | ||
key=${{ github.token }} | ||
url=https://nuget.pkg.github.com/${repoOwner}/index.json | ||
else | ||
key=${{ secrets.NUGET_STIRLINGLABS_API_KEY }} | ||
url=https://api.nuget.org/v3/index.json | ||
fi | ||
dotnet nuget push *.nupkg --api-key $key --source $url --no-symbols --skip-duplicate | ||
[ $? -ne 0 ] && echo "dotnet nuget push to $url returned errorlevel $?" || echo "Success." | ||
complete: | ||
name: Create GitHub Release | ||
needs: [ meta, release ] | ||
runs-on: ubuntu-22.04 | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
DOTNET_NOLOGO: true | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
archiveName: ${{ needs.meta.outputs.project }}-v${{ needs.meta.outputs.textVersion }}.tar.gz | ||
steps: | ||
|
||
- name: Download artifact | ||
id: download | ||
uses: actions/download-artifact@v3 | ||
|
||
- name: Download ancillary files | ||
id: ancillary | ||
env: | ||
rawUrl: 'https://raw.githubusercontent.com/StirlingLabs/tray/master' | ||
readmeFilename: README.md | ||
iconFilename: SL.png | ||
headerFilename: src/tray.h | ||
run: | | ||
readme="README.md" | ||
icon="icon.png" | ||
header="tray.h" | ||
wget --output-document "$readme" "${rawUrl}/${readmeFilename}" | ||
wget --output-document "$icon" "${rawUrl}/${iconFilename}" | ||
wget --output-document "$header" "${rawUrl}/${headerFilename}" | ||
echo "readme=$readme" >> "$GITHUB_OUTPUT" | ||
echo "icon=$icon" >> "$GITHUB_OUTPUT" | ||
echo "header=$header" >> "$GITHUB_OUTPUT" | ||
- name: Create release on GitHub | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ needs.meta.outputs.project}} ${{ needs.meta.outputs.fullVersion }} | ||
files: | | ||
${{ needs.meta.outputs.linuxName }} | ||
${{ needs.meta.outputs.macName }} | ||
${{ needs.meta.outputs.winName }} | ||
${{ steps.ancillary.outputs.readme }} | ||
${{ steps.ancillary.outputs.icon }} | ||
${{ steps.ancillary.outputs.header }} | ||
- name: Dispatch New Release event to tray.Net | ||
if: false | ||
run: > | ||
curl -X POST https://api.github.com/repos/StirlingLabs/tray.Net/dispatches | ||
-H 'Authorization: token ${{secrets.DAEMON_HOOKS}}' | ||
-H "Accept: application/vnd.github.v3+json" | ||
--data '{"event_type":"New tray Release","client_payload":{"tag":"${{needs.meta.outputs.tag}}"}}' |
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
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