Skip to content

Commit

Permalink
Update build-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
neuecc authored Dec 15, 2020
1 parent a39ad0a commit 664a818
Showing 1 changed file with 5 additions and 60 deletions.
65 changes: 5 additions & 60 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,67 +16,22 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: 5.0.100
# set release tag(*.*.*) to env.GIT_TAG
- run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

# build CommandTools first (using dotnet run command in ZLogger.csproj)
- run: dotnet build -c Release src/Ulid -p:Version=${{ env.GIT_TAG }}
- run: dotnet build -c Release src/Ulid.Cli -p:Version=${{ env.GIT_TAG }}
- run: dotnet build -c Release src/Ulid.MessagePack -p:Version=${{ env.GIT_TAG }}
- run: dotnet build -c Release src/Ulid.SystemTextJson -p:Version=${{ env.GIT_TAG }}
- run: dotnet test -c Release ./tests/Ulid.Tests -p:Version=${{ env.GIT_TAG }}
- run: dotnet test -c Release ./tests/Ulid.Cli.Tests -p:Version=${{ env.GIT_TAG }}
- run: dotnet test -c Release ./tests/Ulid.MessagePack.Tests -p:Version=${{ env.GIT_TAG }}
- run: dotnet test -c Release ./tests/Ulid.SystemTextJson.Tests -p:Version=${{ env.GIT_TAG }}
- run: dotnet pack ./src/Ulid -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish
- run: dotnet pack ./src/Ulid.Cli -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish
- run: dotnet pack ./src/Ulid.MessagePack -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish
- run: dotnet pack ./src/Ulid.SystemTextJson -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish
- run: dotnet build -c Release src/UnitGenerator -p:Version=${{ env.GIT_TAG }}
- run: dotnet pack ./src/UnitGenerator -c Release --no-build -p:Version=${{ env.GIT_TAG }} -o ./publish

# Store artifacts.
- uses: actions/upload-artifact@v2
with:
name: nuget
path: ./publish/

build-unity:
strategy:
matrix:
unity: ["2019.3.9f1"]
include:
- unity: 2019.3.9f1
license: UNITY_2019_3
runs-on: ubuntu-latest
container:
# with linux-il2cpp. image from https://hub.docker.com/r/gableroux/unity3d/tags
image: gableroux/unity3d:${{ matrix.unity }}-linux-il2cpp
steps:
- run: apt update && apt install git -y
- uses: actions/checkout@v2
- run: echo -n "$UNITY_LICENSE" >> .Unity.ulf
env:
UNITY_LICENSE: ${{ secrets[matrix.license] }}
- run: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile .Unity.ulf || exit 0

# set release tag(*.*.*) to env.GIT_TAG
- run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

# Execute scripts: Export Package
- name: Export unitypackage
run: /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
working-directory: src/Ulid.Unity
env:
UNITY_PACKAGE_VERSION: ${{ env.GIT_TAG }}

# Store artifacts.
- uses: actions/upload-artifact@v1
with:
name: Ulid.Unity.${{ env.GIT_TAG }}.unitypackage
path: ./src/Ulid.Unity/Ulid.Unity.${{ env.GIT_TAG }}.unitypackage

create-release:
needs: [build-dotnet, build-unity]
needs: [build-dotnet]
runs-on: ubuntu-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Expand All @@ -86,7 +41,7 @@ jobs:
# setup dotnet for nuget push
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.201
dotnet-version: 5.0.100
# set release tag(*.*.*) to env.GIT_TAG
- run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

Expand All @@ -104,13 +59,3 @@ jobs:

# Upload to NuGet
- run: dotnet nuget push "./nuget/*.nupkg" -s https://www.nuget.org/api/v2/package -k ${{ secrets.NUGET_KEY }}

# Upload to Releases(unitypackage)
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Ulid.Unity.${{ env.GIT_TAG }}.unitypackage/Ulid.Unity.${{ env.GIT_TAG }}.unitypackage
asset_name: Ulid.Unity.${{ env.GIT_TAG }}.unitypackage
asset_content_type: application/octet-stream

0 comments on commit 664a818

Please sign in to comment.