csbindgen/.github/workflows/build-release.yml

72 lines
2.1 KiB
YAML
Raw Normal View History

2023-04-15 17:27:25 +01:00
name: Build-Release
on:
workflow_dispatch:
inputs:
tag:
description: "tag: git tag you want create. (sample 1.0.0)"
required: true
dry-run:
description: "dry-run: false = create release/nuget. true = never create release/nuget."
required: true
default: false
type: boolean
2023-04-15 18:07:21 +01:00
env:
GIT_TAG: ${{ github.event.inputs.tag }}
DRY_RUN: ${{ github.event.inputs.dry-run }}
2023-04-15 17:27:25 +01:00
jobs:
2023-04-15 18:07:21 +01:00
build-and-push-rust:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- run: cargo build --verbose
- run: cargo test update_package_version -- {{ inputs.tag }} --nocapture
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: false
- run: cargo publish --manifest-path csbindgen/Cargo.toml
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
2023-04-15 17:27:25 +01:00
build-dotnet:
2023-04-15 18:07:21 +01:00
needs: [build-and-push-rust]
2023-04-15 17:27:25 +01:00
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: Cysharp/Actions/.github/actions/setup-dotnet@main
with:
2023-04-15 18:07:21 +01:00
dotnet-version: 7.0.x
2023-04-15 17:27:25 +01:00
# pack nuget
- run: dotnet build -c Release -p:Version=${{ inputs.tag }}
- run: dotnet pack -c Release --no-build -p:Version=${{ inputs.tag }} -o ./publish
- uses: actions/upload-artifact@v3
with:
name: nuget
path: ./publish
# release
create-release:
2023-04-15 18:07:21 +01:00
needs: [build-and-push-rust, build-dotnet]
2023-04-15 17:27:25 +01:00
uses: Cysharp/Actions/.github/workflows/create-release.yaml@main
with:
dry-run: ${{ inputs.dry-run }}
commit-id: ${{ needs.update-packagejson.outputs.sha }}
tag: ${{ inputs.tag }}
push-tag: true
nuget-push: true
secrets: inherit
cleanup:
if: needs.update-packagejson.outputs.is-branch-created == 'true'
needs: [update-packagejson, create-release]
uses: Cysharp/Actions/.github/workflows/clean-packagejson-branch.yaml@main
with:
branch: ${{ needs.update-packagejson.outputs.branch-name }}