Skip to content

Commit 7daedf5

Browse files
authored
Merge pull request #1775 from itowlson/main-templates-point-to-main-sdk
Point templates on `main` at SDKs on `main`
2 parents 5fd62d4 + fce2170 commit 7daedf5

File tree

7 files changed

+17
-11
lines changed

7 files changed

+17
-11
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- main
6+
- "v[0-9]+.[0-9]+"
67
tags:
78
- "v*"
89

@@ -289,7 +290,14 @@ jobs:
289290

290291
- name: Set the spin tag
291292
shell: bash
292-
run: echo "SPIN_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
293+
run: |
294+
echo "SPIN_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
295+
296+
- name: Set the PR base branch
297+
shell: bash
298+
run: |
299+
IFS=. read -r major minor patch <<< "${{ env.SPIN_TAG }}"
300+
echo "RELEASE_BRANCH=$major.$minor" >> $GITHUB_ENV
293301
294302
- name: Change sdk version
295303
shell: bash
@@ -312,7 +320,7 @@ jobs:
312320
title: "feat(templates): update sdk to ${{ env.SPIN_TAG }}"
313321
body: Update the SDK version used by the templates
314322
branch: update-sdk-${{ env.SPIN_TAG }}
315-
base: main
323+
base: ${{ env.RELEASE_BRANCH }}
316324
delete-branch: true
317325
committer: fermybot <[email protected]>
318326
author: fermybot <[email protected]>

docs/content/release-process.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ To cut a major / minor release of Spin, you will need to do the following:
1414

1515
1. Switch to the release branch locally and update versions (e.g. `1.1.0-pre0` could `1.1.0`).
1616
- Bump the version in Spin's `Cargo.toml`
17-
- Update SDK_VERSION in `templates/Makefile`
1817
- Run `make build` so that `Cargo.lock` and other associated files are updated
1918

2019
PR these changes to the release branch ensuring that pull request has a base corresponding to the release branch (e.g. `v1.1`).
@@ -62,7 +61,6 @@ $ ./.github/gh-backport.sh <pull-request> <branch-name>
6261
6362
1. Switch to the release branch locally and update versions (e.g. `1.1.0-pre0` could `1.1.1`).
6463
- Bump the version in Spin's `Cargo.toml`
65-
- Update SDK_VERSION in `templates/Makefile`
6664
- Run `make build` so that `Cargo.lock` and other associated files are updated
6765
6866
PR these changes to the release branch ensuring that pull request has a base corresponding to the release branch (e.g. `v1.1`).

templates/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
SDK_VERSION ?= v2.0.0-pre0
1+
SDK_VERSION ?= v0.0.0
22

33
bump-versions: bump-go-versions bump-rust-versions
44

55
bump-go-versions:
66
@for dir in $$(ls -d *-go) ; do \
77
cd $$dir/content ; \
8-
sed -i.sed-bak -e 's%require github.com/fermyon/spin/sdk/go v.*%require github.com/fermyon/spin/sdk/go ${SDK_VERSION}%g' go.mod ; \
8+
sed -r -i.sed-bak -e 's%require github.com/fermyon/spin/sdk/go [a-zA-Z0-9.]+%require github.com/fermyon/spin/sdk/go ${SDK_VERSION}%g' go.mod ; \
99
sed -i.sed-bak -e 's/{{project-name | snake_case}}/foo/g' go.mod ; \
1010
go mod tidy ; \
1111
sed -i.sed-bak -e 's/foo/{{project-name | snake_case}}/g' go.mod ; \
@@ -16,7 +16,7 @@ bump-go-versions:
1616
bump-rust-versions:
1717
@for dir in $$(ls -d *-rust) ; do \
1818
cd $$dir/content ; \
19-
sed -i.sed-bak -e 's%"https://github.com/fermyon/spin", tag = "v.*"%"https://github.com/fermyon/spin", tag = "${SDK_VERSION}"%g' Cargo.toml ; \
19+
sed -r -i.sed-bak -e 's%"https://github.com/fermyon/spin", ((tag = "[a-zA-Z0-9.]+")|(branch = "main"))%"https://github.com/fermyon/spin", tag = "${SDK_VERSION}"%g' Cargo.toml ; \
2020
rm *.sed-bak ; \
2121
cd - 2>&1 >/dev/null ; \
2222
done

templates/http-go/content/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module github.com/{{project-name | snake_case}}
22

33
go 1.17
44

5-
require github.com/fermyon/spin/sdk/go v1.5.1
5+
require github.com/fermyon/spin/sdk/go main
66

77
require github.com/julienschmidt/httprouter v1.3.0 // indirect

templates/http-rust/content/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ bytes = "1"
1616
# General-purpose crate with common HTTP types.
1717
http = "0.2"
1818
# The Spin SDK.
19-
spin-sdk = { git = "https://github.com/fermyon/spin", tag = "v1.5.1" }
19+
spin-sdk = { git = "https://github.com/fermyon/spin", branch = "main" }
2020

2121
[workspace]

templates/redis-go/content/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/{{project-name | snake_case}}
22

33
go 1.17
44

5-
require github.com/fermyon/spin/sdk/go v1.5.1
5+
require github.com/fermyon/spin/sdk/go main

templates/redis-rust/content/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ anyhow = "1"
1414
# Crate to simplify working with bytes.
1515
bytes = "1"
1616
# The Spin SDK.
17-
spin-sdk = { git = "https://github.com/fermyon/spin", tag = "v1.5.1" }
17+
spin-sdk = { git = "https://github.com/fermyon/spin", branch = "main" }
1818

1919
[workspace]

0 commit comments

Comments
 (0)