-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c53e0e2
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release: # e.g. 'v0.8.1 ' | ||
description: Tanssi release tag | ||
required: true | ||
rust: # e.g. '1.78.0' | ||
description: Rust version | ||
required: true | ||
title: # e.g. 'Tanssi v0.8.1' | ||
description: Release title | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.platform.os }} | ||
permissions: | ||
contents: write | ||
strategy: | ||
matrix: | ||
package: | ||
- tanssi-node | ||
platform: | ||
# Linux | ||
- os: ubuntu-22.04 | ||
target: aarch64-unknown-linux-gnu | ||
- os: ubuntu-22.04 | ||
target: x86_64-unknown-linux-gnu | ||
# macOS | ||
- os: macos-14 | ||
target: aarch64-apple-darwin | ||
- os: macos-14 | ||
target: x86_64-apple-darwin | ||
env: | ||
RUSTFLAGS: "${{ matrix.platform.cpu != '' && format('-C target-cpu={0}', matrix.platform.cpu) || '' }} ${{ matrix.platform.target == 'aarch64-unknown-linux-gnu' && '-C linker=aarch64-linux-gnu-gcc' || '' }}" | ||
path: "target/${{ matrix.platform.target }}/production" | ||
archive: "${{ matrix.package }}-${{ matrix.platform.target }}${{ matrix.platform.cpu != '' && format('-{0}', matrix.platform.cpu) || '' }}.tar.gz" | ||
sha: ${{ contains(matrix.platform.target, 'apple') && 'shasum -a 256' || 'sha256sum' }} | ||
steps: | ||
- name: Free up space | ||
shell: bash | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf "/usr/local/share/boost" | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
# Clone and checkout release | ||
- id: clone | ||
name: Clone release | ||
run: | | ||
git clone --branch ${{ github.event.inputs.release }} --depth 1 https://github.com/moondance-labs/tanssi | ||
cd tanssi | ||
echo "rev=$(git rev-parse --short HEAD | tr -d '\n')" >> "$GITHUB_OUTPUT" | ||
# Install packages | ||
- name: Install packages (Linux) | ||
if: contains(matrix.platform.target, 'linux') | ||
run: sudo apt-get install -y protobuf-compiler ${{ contains(matrix.platform.target, 'aarch64') && 'crossbuild-essential-arm64' || '' }} | ||
- name: Install packages (macOS) | ||
if: contains(matrix.platform.target, 'apple') | ||
run: brew install protobuf | ||
|
||
# Configure Rust toolchain | ||
- name: Set Rust version | ||
run: | | ||
rustup default ${{ github.event.inputs.rust }} | ||
rustup component add rust-src | ||
rustup target add ${{ matrix.platform.target }} wasm32-unknown-unknown | ||
# Build and package | ||
- name: Build ${{ matrix.package }} | ||
working-directory: tanssi | ||
run: cargo b --profile=production -p ${{ matrix.package == 'tanssi-node' || matrix.package }} -F fast-runtime --target ${{ matrix.platform.target }} | ||
- name: Package tanssi-node | ||
if: matrix.package == 'tanssi-node' | ||
working-directory: tanssi/${{ env.path }} | ||
run: | | ||
${{ env.sha }} tanssi-node > tanssi-node.sha256 | ||
tar -czf ${{ env.archive }} tanssi-node tanssi-node.sha256 | ||
# Add package to workflow | ||
- name: Upload archives | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: binaries | ||
path: | | ||
tanssi/${{ env.path }}/${{ env.archive }} | ||
# Add package to release | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: ${{ github.event.inputs.title }} | ||
tag_name: ${{ github.event.inputs.release }} | ||
body: "Release generated from release tag `${{ github.event.inputs.release }}` (commit: `${{ steps.clone.outputs.rev }}`) and using Rust `${{ github.event.inputs.rust }}`.\n\nPlease see https://github.com/moondance-labs/tanssi/releases/tag/${{ github.event.inputs.release }} for release notes." | ||
files: | | ||
tanssi/${{ env.path }}/${{ env.archive }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Tanssi Releases | ||
> ⚠️ NOTE: These builds are provided for development purposes only! | ||
This repo provides cross-platform builds of Tanssi and related binaries for usage with [`pop-cli`](https://github.com/r0gue-io/pop-cli) only. | ||
|
||
Builds are generated using the release tags at https://github.com/moondance-labs/tanssi/releases, along with the Rust compiler version noted within the release notes of each release. | ||
|
||
The [workflow](./.github/workflows/release.yml) generates the cross-platform binaries and creates a corresponding release with the same release tag. The corresponding commit hash is added to the release notes for additional verification. | ||
|
||
## Support Platforms | ||
The currently supported platforms/targets are as follows: | ||
- Linux | ||
- `aarch64-unknown-linux-gnu` | ||
- `x86_64-unknown-linux-gnu` | ||
- macOS | ||
- `aarch64-apple-darwin` | ||
- `x86_64-apple-darwin` |