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

64 lines
2.0 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
2023-04-15 18:07:21 +01:00
env:
GIT_TAG: ${{ github.event.inputs.tag }}
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
2023-04-17 12:15:32 +01:00
- run: cargo test update_package_version -- ${{ inputs.tag }} --nocapture
2023-04-17 12:30:24 +01:00
- run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Update cargo.toml version to ${{ env.GIT_TAG }}" -a
2023-04-17 12:16:15 +01:00
- run: cargo publish --manifest-path csbindgen/Cargo.toml
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
2023-04-17 12:15:32 +01:00
- run: git tag ${{ env.GIT_TAG }}
2023-04-15 18:07:21 +01:00
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
2023-04-17 12:15:32 +01:00
tags: true
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
2023-04-17 12:08:00 +01:00
- run: dotnet nuget push "./publish/*.nupkg" -s https://www.nuget.org/api/v2/package -k ${{ secrets.NUGET_KEY }}
2023-04-15 17:27:25 +01:00
create-release:
2023-04-17 12:08:00 +01:00
needs: [build-dotnet, build-and-push-rust]
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