diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9b2a1c9..6efa81d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,68 +1,54 @@ name: Build, Pack & Publish on: - push: - branches: - - master # Default release branch + release: + types: [published] + workflow_dispatch: jobs: publish: name: build, pack & publish runs-on: ubuntu-latest steps: - name: Get the sources - uses: actions/checkout@v2 - - name: Run the build script - uses: cake-build/cake-action@v1 - with: - script-path: build.cake - target: Pack - cake-bootstrap: true - - name: Publish Solnet.Anchor.Tool on version change - uses: bmresearch/publish-nuget@master + uses: actions/checkout@v4 + - name: Test and Pack + shell: bash + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + run: | + dotnet tool install Cake.Tool --version 1.1.0 + dotnet tool restore + dotnet cake --target=Pack --verbosity=verbose + - name: Publish Solana.Unity.Anchor + uses: Rebel028/publish-nuget@v2.8.0 with: - PROJECT_FILE_PATH: Solnet.Anchor.Tool/Solnet.Anchor.Tool.csproj - PACKAGE_NAME: Solnet.Anchor.Tool + PROJECT_FILE_PATH: Solana.Unity.Anchor/Solana.Unity.Anchor.csproj + PACKAGE_NAME: Solana.Unity.Anchor VERSION_FILE_PATH: SharedBuildProperties.props VERSION_REGEX: ^\s*(.*)<\/Version>\s*$ TAG_FORMAT: v* NUGET_KEY: ${{secrets.NUGET_API_KEY}} + NUGET_SOURCE: https://api.nuget.org/v3/index.json INCLUDE_SYMBOLS: true - - name: Publish Solnet.Anchor.SourceGenerator on version change - uses: bmresearch/publish-nuget@master - id: publish_nuget + - name: Publish Solana.Unity.Anchor.Tool + uses: Rebel028/publish-nuget@v2.8.0 with: - PROJECT_FILE_PATH: Solnet.Anchor.SourceGenerator/Solnet.Anchor.SourceGenerator.csproj - PACKAGE_NAME: Solnet.Anchor.SourceGenerator + PROJECT_FILE_PATH: Solana.Unity.Anchor.Tool/Solana.Unity.Anchor.Tool.csproj + PACKAGE_NAME: Solana.Unity.Anchor.Tool VERSION_FILE_PATH: SharedBuildProperties.props VERSION_REGEX: ^\s*(.*)<\/Version>\s*$ TAG_FORMAT: v* NUGET_KEY: ${{secrets.NUGET_API_KEY}} + NUGET_SOURCE: https://api.nuget.org/v3/index.json INCLUDE_SYMBOLS: true - - name: Build Changelog - id: build_changelog - uses: mikepenz/release-changelog-builder-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - - name: Create GitHub Release - id: create_release - uses: actions/create-release@v1 - with: - tag_name: ${{ steps.publish_nuget.outputs.VERSION }} - release_name: ${{ steps.publish_nuget.outputs.VERSION }} - body: ${{ steps.build_changelog.outputs.changelog }} - env: - GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - - name: Upload release assets - uses: svenstaro/upload-release-action@v2 + - name: Publish Solana.Unity.Anchor.SourceGenerator + uses: Rebel028/publish-nuget@v2.8.0 with: - repo_token: ${{ secrets.ACCESS_TOKEN }} - file: artifacts/Solnet.Anchor.SourceGenerator.dll - tag: ${{ steps.publish_nuget.outputs.VERSION }} - upload_url: ${{ steps.create_release.outputs.upload_url }} - - name: Upload release assets - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.ACCESS_TOKEN }} - file: artifacts/Solnet.Anchor.Tool.dll - tag: ${{ steps.publish_nuget.outputs.VERSION }} - upload_url: ${{ steps.create_release.outputs.upload_url }} + PROJECT_FILE_PATH: Solana.Unity.Anchor.SourceGenerator/Solana.Unity.Anchor.SourceGenerator.csproj + PACKAGE_NAME: Solana.Unity.Anchor.SourceGenerator + VERSION_FILE_PATH: SharedBuildProperties.props + VERSION_REGEX: ^\s*(.*)<\/Version>\s*$ + TAG_FORMAT: v* + NUGET_KEY: ${{secrets.NUGET_API_KEY}} + NUGET_SOURCE: https://api.nuget.org/v3/index.json + INCLUDE_SYMBOLS: true \ No newline at end of file diff --git a/SharedBuildProperties.props b/SharedBuildProperties.props index 340ef95..effd94b 100644 --- a/SharedBuildProperties.props +++ b/SharedBuildProperties.props @@ -2,11 +2,11 @@ xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> Solana.Unity.Anchor - 0.2.9 - Copyright 2022 © Garbles Labs - Garbles Labs - Garbles Labs - https://github.com/garbles-labs/Solana.Unity.Anchor + 0.2.11 + Copyright 2023 © Magicblock + Magicblock + Magicblock + https://github.com/magicblock-labs/Solana.Unity.Anchor latest MIT icon.png