This commit is contained in:
neuecc 2023-04-17 20:08:00 +09:00
parent e4b25c3d73
commit 71805d0668

View File

@ -6,15 +6,9 @@ on:
tag: tag:
description: "tag: git tag you want create. (sample 1.0.0)" description: "tag: git tag you want create. (sample 1.0.0)"
required: true required: true
dry-run:
description: "dry-run: false = create release/nuget. true = never create release/nuget."
required: true
default: false
type: boolean
env: env:
GIT_TAG: ${{ github.event.inputs.tag }} GIT_TAG: ${{ github.event.inputs.tag }}
DRY_RUN: ${{ github.event.inputs.dry-run }}
jobs: jobs:
build-and-push-rust: build-and-push-rust:
@ -46,26 +40,20 @@ jobs:
# pack nuget # pack nuget
- run: dotnet build -c Release -p:Version=${{ inputs.tag }} - run: dotnet build -c Release -p:Version=${{ inputs.tag }}
- run: dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish - run: dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish
- uses: actions/upload-artifact@v3 - run: dotnet nuget push "./publish/*.nupkg" -s https://www.nuget.org/api/v2/package -k ${{ secrets.NUGET_KEY }}
with:
name: nuget
path: ./publish
# release
create-release: create-release:
needs: [build-and-push-rust, build-dotnet] needs: [build-dotnet, build-and-push-rust]
uses: Cysharp/Actions/.github/workflows/create-release.yaml@main runs-on: ubuntu-latest
with: timeout-minutes: 10
dry-run: ${{ inputs.dry-run }} steps:
commit-id: ${{ needs.update-packagejson.outputs.sha }} # Create Releases
tag: ${{ inputs.tag }} - uses: actions/create-release@v1
push-tag: true id: create_release
nuget-push: true env:
secrets: inherit GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
cleanup: tag_name: ${{ env.GIT_TAG }}
if: needs.update-packagejson.outputs.is-branch-created == 'true' release_name: Ver.${{ env.GIT_TAG }}
needs: [update-packagejson, create-release] draft: true
uses: Cysharp/Actions/.github/workflows/clean-packagejson-branch.yaml@main prerelease: false
with:
branch: ${{ needs.update-packagejson.outputs.branch-name }}