Skip to content
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c5a4c69
feat(ci): go release workflow
thibault-martinez Nov 14, 2025
a57a3ae
0.0.1
thibault-martinez Nov 14, 2025
5e04743
fix repo
thibault-martinez Nov 14, 2025
528fc55
git add
thibault-martinez Nov 14, 2025
6fd5ff4
build linux
thibault-martinez Nov 14, 2025
f58d2a2
darwin
thibault-martinez Nov 14, 2025
a1d3de9
0.0.4
thibault-martinez Nov 14, 2025
a7de76d
add RUSTFLAGS
thibault-martinez Nov 14, 2025
df29890
-install_name,@rpath
thibault-martinez Nov 14, 2025
0ff3410
RUSTFLAGS="-C link-args=-Wl,-rpath,$ORIGIN"
thibault-martinez Nov 14, 2025
cc0fe91
please work
thibault-martinez Nov 14, 2025
4706a42
add windows support
thibault-martinez Nov 14, 2025
a4386f7
ls
thibault-martinez Nov 14, 2025
ebecb54
dprint
thibault-martinez Nov 14, 2025
92039fb
remove lib prefix
thibault-martinez Nov 14, 2025
cf3dd94
LATEST_TAG
thibault-martinez Nov 15, 2025
6a8090a
use bumped version
thibault-martinez Nov 15, 2025
7a41364
uncomment
thibault-martinez Nov 15, 2025
2afed4a
bring back step
thibault-martinez Nov 15, 2025
9b7121a
disable pull_request
thibault-martinez Nov 15, 2025
8483be5
patch default
thibault-martinez Nov 15, 2025
173a596
remove extra v
thibault-martinez Nov 15, 2025
907cf4c
nits
thibault-martinez Nov 17, 2025
f4a124b
use a better matrix
thibault-martinez Nov 17, 2025
7197898
fix
thibault-martinez Nov 17, 2025
42f0196
dprint
thibault-martinez Nov 17, 2025
6deb467
try download all?
thibault-martinez Nov 17, 2025
310e6b4
tmp folder
thibault-martinez Nov 17, 2025
1aac9c7
merge-multiple: true
thibault-martinez Nov 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions .github/workflows/go_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: Go Release
on:
pull_request: # TODO REMOVE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do it last, still doing 1 or 2 tests 👍🏻

workflow_dispatch:
inputs:
version: # TODO remove?
description: "Version for the go package"
required: true
type: string
level:
description: |
The level of version bump to make.

Possible values:
- major: Increase the major version (x.0.0)
- minor: Increase the minor version (x.y.0)
- patch: Increase the patch version (x.y.z)
- release: Remove the pre-version (x.y.z)
- rc: Increase the rc pre-version (x.y.z-rc.M)
- beta: Increase the beta pre-version (x.y.z-beta.M)
- alpha: Increase the alpha pre-version (x.y.z-alpha.M)
type: choice
required: true
options: # TODO take from semver cmd
- major
- minor
- patch
- release
- rc
- beta
- alpha

jobs:
prepare-source-archive:
name: Prepare source archive
runs-on: ubuntu-latest
steps:
- name: Checkout iota-rust-sdk
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0

- name: Archive Go bindings
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: source
path: bindings/go/iota_sdk

prepare-build-archives:
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
lib: libiota_sdk_ffi.dylib
folder: darwin-amd64
- os: macos-latest
target: aarch64-apple-darwin
lib: libiota_sdk_ffi.dylib
folder: darwin-aarch64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
lib: libiota_sdk_ffi.so
folder: linux-amd64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
lib: libiota_sdk_ffi.so
folder: linux-aarch64
- os: windows-latest
target: x86_64-pc-windows-msvc
lib: iota_sdk_ffi.dll
folder: windows-amd64
- os: windows-latest
target: aarch64-pc-windows-msvc
lib: iota_sdk_ffi.dll
folder: windows-aarch64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout iota-rust-sdk
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0

- name: Install rust target ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}

- name: Install gcc-aarch64-linux-gnu
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu

- name: Install gcc-x86-64-linux-gnu
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-x86-64-linux-gnu g++-x86-64-linux-gnu

- name: Build ${{ matrix.target }} bindings
if: matrix.os == 'macos-latest'
run: RUSTFLAGS="-C link-args=-Wl,-install_name,@rpath/${{ matrix.lib }}" cargo build -p iota-sdk-ffi --lib --release --target ${{ matrix.target }}

- name: Build ${{ matrix.target }} bindings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and the previous step have the same name atm

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It includes the target so they are different

if: matrix.os == 'ubuntu-latest'
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/x86_64-linux-gnu-gcc
run: RUSTFLAGS="-C link-args=-Wl,-rpath,$ORIGIN" cargo build -p iota-sdk-ffi --lib --release --target ${{ matrix.target }}

- name: Build ${{ matrix.target }} bindings
if: matrix.os == 'windows-latest'
run: cargo build -p iota-sdk-ffi --lib --release --target ${{ matrix.target }}

- name: Prepare upload
run: |
mkdir -p tmp/lib/${{ matrix.folder }}
cp target/${{ matrix.target }}/release/${{ matrix.lib }} tmp/lib/${{ matrix.folder }}/${{ matrix.lib }}

- name: Archive ${{ matrix.target }} bindings
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: ${{ matrix.target }}
path: tmp

release-archives:
name: Release archives
runs-on: ubuntu-latest
needs:
- prepare-source-archive
- prepare-build-archives
steps:
- name: Checkout iota-sdk-go
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
with:
repository: iotaledger/iota-sdk-go
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_FOR_GO_SDK }}
fetch-depth: 0

- name: Get latest tag from iota-sdk-go
id: get-latest-tag
run: |
LATEST_TAG=$(git tag --sort=-v:refname | head -n 1)
if [ -z "$LATEST_TAG" ]; then
LATEST_TAG="v0.0.0"
fi
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
echo "Latest tag: $LATEST_TAG"

- uses: actions-ecosystem/action-bump-semver@34e334551143a5301f38c830e44a22273c6ff5c5 # v1.0.0
Copy link
Contributor

@Alex6323 Alex6323 Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

give that step also a name? (also for other steps down below)

id: bump-semver
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
level: ${{ inputs.level || 'patch' }} # TODO undo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder


- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
merge-multiple: true

- name: Tag the Go package
run: |
git config --global user.email [email protected]
git config --global user.name github-actions
git add .
git commit -m "Update Go bindings to version ${{ steps.bump-semver.outputs.new_version }}"
git push
git tag ${{ steps.bump-semver.outputs.new_version }} -m "${{ steps.bump-semver.outputs.new_version }}"
git push --tags
Loading