Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Cysharp/Actions/.github/workflows/create-release.yaml #150

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 18 additions & 24 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ on:
required: true
default: false
type: boolean

env:
GIT_TAG: ${{ github.event.inputs.tag }}


jobs:
update-packagejson:
uses: Cysharp/Actions/.github/workflows/update-packagejson.yaml@main
with:
file-path: ./src/ZLogger.Unity/Assets/ZLogger.Unity/package.json
tag: ${{ github.event.inputs.tag }}
dry-run: ${{ fromJson(github.event.inputs.dry-run) }}
tag: ${{ inputs.tag }}
dry-run: ${{ inputs.dry-run }}

build-dotnet:
needs: [update-packagejson]
runs-on: ubuntu-latest
Expand All @@ -38,28 +35,25 @@ jobs:
- run: dotnet build -c Release -p:Version=${{ inputs.tag }}
- run: dotnet test -c Release --no-build
- run: dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish
- run: dotnet nuget push "./publish/*.nupkg" -s https://www.nuget.org/api/v2/package -k ${{ secrets.NUGET_KEY }}
# Store artifacts.
- uses: actions/upload-artifact@v2
with:
name: nuget
path: ./publish/

# release
create-release:
if: github.event.inputs.dry-run == 'false'
needs: [update-packagejson, build-dotnet]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Create Releases
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.GIT_TAG }}
release_name: Ver.${{ env.GIT_TAG }}
draft: true
prerelease: false
uses: Cysharp/Actions/.github/workflows/create-release.yaml@main
with:
commit-id: ${{ needs.update-packagejson.outputs.sha }}
tag: ${{ inputs.tag }}
dry-run: ${{ inputs.dry-run }}
nuget-push: true
release-upload: false
secrets: inherit

cleanup:
if: needs.update-packagejson.outputs.is-branch-created == 'true'
if: ${{ needs.update-packagejson.outputs.is-branch-created == 'true' }}
needs: [update-packagejson, build-dotnet]
uses: Cysharp/Actions/.github/workflows/clean-packagejson-branch.yaml@main
with:
Expand Down
Loading