Skip to content

Commit

Permalink
🐛 Fix generation for f32 and f64 types (#4)
Browse files Browse the repository at this point in the history
* 🐛 Fix generation for f32 and f64 types

* 👷 Dump version and add CI/CD publishing
  • Loading branch information
GabrielePicco authored Feb 26, 2024
1 parent f9c007b commit 6de4736
Show file tree
Hide file tree
Showing 7 changed files with 721 additions and 52 deletions.
78 changes: 32 additions & 46 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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>(.*)<\/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>(.*)<\/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>(.*)<\/Version>\s*$
TAG_FORMAT: v*
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
NUGET_SOURCE: https://api.nuget.org/v3/index.json
INCLUDE_SYMBOLS: true
10 changes: 5 additions & 5 deletions SharedBuildProperties.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Product>Solana.Unity.Anchor</Product>
<Version>0.2.9</Version>
<Copyright>Copyright 2022 &#169; Garbles Labs</Copyright>
<Authors>Garbles Labs</Authors>
<PublisherName>Garbles Labs</PublisherName>
<RepositoryUrl>https://github.com/garbles-labs/Solana.Unity.Anchor</RepositoryUrl>
<Version>0.2.11</Version>
<Copyright>Copyright 2023 &#169; Magicblock</Copyright>
<Authors>Magicblock</Authors>
<PublisherName>Magicblock</PublisherName>
<RepositoryUrl>https://github.com/magicblock-labs/Solana.Unity.Anchor</RepositoryUrl>
<LangVersion>latest</LangVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>icon.png</PackageIcon>
Expand Down
1 change: 1 addition & 0 deletions Solana.Unity.Anchor.Test/Resources/Empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"0.1.0","name":"hello_world","instructions":[{"name":"hello","accounts":[],"args":[]}]}
Loading

0 comments on commit 6de4736

Please sign in to comment.