Skip to content

Commit 78f84e7

Browse files
authored
move Rust and Go SDKs to their own repos (#2289)
* move Rust and Go SDKs to their own repos These SDKs and their examples have moved to https://github.com/fermyon/spin-rust-sdk and https://github.com/fermyon/spin-go-sdk, respectively. The plan is to begin releasing them on their own cadence, independent of Spin releases. This will allow us to make breaking changes in semver-compatible major releases without tying such releases to a Spin major release, e.g. to target WASI 0.2.0. Note that I've update the integration tests which use the Rust SDK to use the latest stable release (2.2.0) instead of a path-based dependency. Alternatively, we could point it at the `main` branch of the `spin-rust-sdk` Git repo, but that will require close coordination once we start making breaking changes to the API in that repo. We may also want to move the Rust and Go templates to the new repos at some point. I've left them where they are for the time being. Finally, I've removed the SDK-specific bits from release-process.md and the GitHub workflows. We'll need to move those things to their respective SDK repos. Reproducing the automated Go SDK tagging that feeds into the templates may require moving at least the Go templates as noted above. Signed-off-by: Joel Dice <[email protected]> * restore accidentally-removed lines from release-process.md Signed-off-by: Joel Dice <[email protected]> * update SDK examples links to point to `stable` branches We'll update the `stable` branch of the applicable repo each time we make a new stable release of any of the SDKs so that these links always point to the examples for the latest stable release rather than `main`. Signed-off-by: Joel Dice <[email protected]> * re-add (updated version of) `push-templates-tag` to release.yml Unlike the original version, this one does not depend on the Go SDK automation and instead derives the template tag name from the Spin version tag name. Signed-off-by: Joel Dice <[email protected]> * re-add `build-and-sign` as dependency of `push-templates-tag` This ensures that we don't tag a broken build. Signed-off-by: Joel Dice <[email protected]> --------- Signed-off-by: Joel Dice <[email protected]>
1 parent 663593d commit 78f84e7

File tree

266 files changed

+57
-22077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+57
-22077
lines changed

.github/gh-checktags.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
22

33
## for the release tags v*, check if
4-
## - golang sdk tag exists
54
## - spin templates tag exists
65

76
set -e
@@ -23,12 +22,6 @@ for tag in $tags; do
2322
continue
2423
fi
2524

26-
# check golang sdk tag
27-
if [[ -z "$(git tag -l sdk/go/$tag)" ]]; then
28-
echo "tag sdk/go/$tag does not exist"
29-
exit_code=1
30-
fi
31-
3225
# remove trailing .\d+ from the version
3326
major_minor=`echo $tag | sed 's/\.[0-9]*$//g'`
3427

.github/workflows/build.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -167,36 +167,6 @@ jobs:
167167
# Only run integration tests on macOS as they will be run on ubuntu separately
168168
if: ${{ matrix.runner == 'macos-latest' }}
169169

170-
test-go:
171-
name: Test Spin SDK - Go
172-
runs-on: ubuntu-latest
173-
needs: build-rust-ubuntu
174-
steps:
175-
- uses: actions/checkout@v3
176-
177-
- name: Retrieve saved Spin Binary
178-
uses: actions/download-artifact@v3
179-
with:
180-
name: spin-ubuntu-latest
181-
path: target/debug/
182-
183-
- name: Fix Spin Binary permissions
184-
run: |
185-
ls -lah target/
186-
ls -lah target/debug
187-
chmod +x target/debug/spin
188-
189-
- name: setup dependencies
190-
uses: ./.github/actions/spin-ci-dependencies
191-
with:
192-
rust: true
193-
golang: true
194-
tinygo: true
195-
wasmtime: true
196-
197-
- name: "Test Go SDK"
198-
run: make test-sdk-go
199-
200170
all-integration-tests:
201171
# run on a larger runner for more SSD/resource access
202172
runs-on: ubuntu-22.04-4core-spin

.github/workflows/check-tags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check tags for templates and sdk
1+
name: Check tags for templates
22
on:
33
schedule:
44
- cron: '0 0 * * *'

.github/workflows/release.yml

Lines changed: 2 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -254,84 +254,17 @@ jobs:
254254
--title ${{ github.ref_name }} \
255255
--generate-notes ${{ env.PRERELEASE }}
256256
257-
create-go-sdk-tag:
258-
name: create tag sdk/go/v*
259-
runs-on: ubuntu-latest
260-
needs: build-and-sign
261-
if: startsWith(github.ref, 'refs/tags/v')
262-
steps:
263-
- uses: actions/checkout@v3
264-
265-
- name: Set the tag to sdk/go/v*
266-
shell: bash
267-
run: echo "GO_SDK_TAG=sdk/go/${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
268-
269-
- name: Tag sdk/go/v* and push it
270-
shell: bash
271-
env:
272-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
273-
run: |
274-
git tag ${{ env.GO_SDK_TAG }}
275-
git push origin ${{ env.GO_SDK_TAG }}
276-
277-
create-template-sdk-update-pr:
278-
name: Create PR with template SDK updates
279-
runs-on: ubuntu-latest
280-
needs: create-go-sdk-tag
281-
if: startsWith(github.ref, 'refs/tags/v')
282-
steps:
283-
- uses: actions/checkout@v3
284-
285-
- name: Set the spin tag
286-
shell: bash
287-
run: |
288-
echo "SPIN_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
289-
290-
- name: Set the PR base branch
291-
shell: bash
292-
run: |
293-
IFS=. read -r major minor patch <<< "${{ env.SPIN_TAG }}"
294-
echo "RELEASE_BRANCH=$major.$minor" >> $GITHUB_ENV
295-
296-
- name: Change sdk version
297-
shell: bash
298-
run: |
299-
cd templates
300-
SDK_VERSION=${{ env.SPIN_TAG }} make
301-
302-
- name: Import GPG key
303-
uses: crazy-max/ghaction-import-gpg@v5
304-
with:
305-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
306-
passphrase: ${{ secrets.PASSPHRASE }}
307-
git_user_signingkey: true
308-
git_commit_gpgsign: true
309-
310-
- name: Create Pull Request
311-
uses: peter-evans/create-pull-request@v4
312-
with:
313-
commit-message: "feat(templates): update sdk to ${{ env.SPIN_TAG }}"
314-
title: "feat(templates): update sdk to ${{ env.SPIN_TAG }}"
315-
body: Update the SDK version used by the templates
316-
branch: update-sdk-${{ env.SPIN_TAG }}
317-
base: ${{ env.RELEASE_BRANCH }}
318-
delete-branch: true
319-
committer: fermybot <[email protected]>
320-
author: fermybot <[email protected]>
321-
signoff: true
322-
323-
# This will run when the PR above is approved and merged into main via a merge commit
324257
push-templates-tag:
325258
runs-on: ubuntu-latest
326259
needs: build-and-sign
327-
if: github.event.commits[0].author.name == 'fermybot' && contains(github.event.commits[0].message, 'update sdk')
260+
if: startsWith(github.ref, 'refs/tags/v')
328261
steps:
329262
- uses: actions/checkout@v3
330263

331264
- name: Set the tag to spin/templates/v*
332265
shell: bash
333266
run: |
334-
spin_tag=$(echo "${{ github.event.commits[0].message }}" | grep -Eo v[0-9.]+)
267+
spin_tag=$(echo "${{ github.ref }}" | grep -Eo "refs/tags/v[0-9.]+")
335268
IFS=. read -r major minor patch <<< "${spin_tag}"
336269
echo "TEMPLATE_TAG=spin/templates/$major.$minor" >> $GITHUB_ENV
337270
@@ -431,23 +364,3 @@ jobs:
431364
with:
432365
name: spin
433366
path: _dist/spin-${{ env.RELEASE_VERSION }}-static-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
434-
435-
crates:
436-
name: Publish to crates.io
437-
runs-on: ubuntu-latest
438-
needs: build-and-sign
439-
if: |
440-
startsWith(github.ref, 'refs/tags/v') &&
441-
github.repository_owner == 'fermyon'
442-
steps:
443-
- uses: actions/checkout@v2
444-
445-
- name: Publish spin-macro to crates.io
446-
working-directory: ./sdk/rust/macro
447-
run: |
448-
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
449-
450-
- name: Publish spin-sdk to crates.io
451-
working-directory: ./sdk/rust
452-
run: |
453-
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

Cargo.lock

Lines changed: 0 additions & 132 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ llm-cublas = ["llm", "spin-trigger-http/llm-cublas"]
117117
[workspace]
118118
members = [
119119
"crates/*",
120-
"sdk/rust",
121-
"sdk/rust/macro",
122120
"tests/runtime-tests",
123121
"tests/testing-framework",
124122
]

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export PATH := target/debug:target/release:$(HOME)/.cargo/bin:$(PATH)
55

66
## overrides for Windows
77
ifeq ($(OS),Windows_NT)
8-
LOG_LEVEL_VAR =
8+
LOG_LEVEL_VAR =
99
endif
1010

1111
.PHONY: build
@@ -39,7 +39,7 @@ lint-all: lint lint-rust-examples
3939

4040
## Bring all of the checked in `Cargo.lock` files up-to-date
4141
.PHONY: update-cargo-locks
42-
update-cargo-locks:
42+
update-cargo-locks:
4343
echo "Updating Cargo.toml"
4444
cargo update -w --offline; \
4545
for manifest_path in $$(find examples -name Cargo.toml); do \
@@ -71,10 +71,6 @@ test-integration: test-runtime
7171
test-integration-full: test-runtime-full
7272
cargo test --release integration_tests --no-default-features --features extern-dependencies-tests --no-fail-fast -- --nocapture
7373

74-
.PHONY: test-sdk-go
75-
test-sdk-go:
76-
$(MAKE) -C sdk/go test
77-
7874
# simple convenience for developing with TLS
7975
.PHONY: tls
8076
tls: ${CERT_NAME}.crt.pem

0 commit comments

Comments
 (0)