Skip to content

Commit

Permalink
Merge pull request #1775 from itowlson/main-templates-point-to-main-sdk
Browse files Browse the repository at this point in the history
Point templates on `main` at SDKs on `main`
  • Loading branch information
itowlson authored Oct 19, 2023
2 parents 5fd62d4 + fce2170 commit 7daedf5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- "v[0-9]+.[0-9]+"
tags:
- "v*"

Expand Down Expand Up @@ -289,7 +290,14 @@ jobs:

- name: Set the spin tag
shell: bash
run: echo "SPIN_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
run: |
echo "SPIN_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Set the PR base branch
shell: bash
run: |
IFS=. read -r major minor patch <<< "${{ env.SPIN_TAG }}"
echo "RELEASE_BRANCH=$major.$minor" >> $GITHUB_ENV
- name: Change sdk version
shell: bash
Expand All @@ -312,7 +320,7 @@ jobs:
title: "feat(templates): update sdk to ${{ env.SPIN_TAG }}"
body: Update the SDK version used by the templates
branch: update-sdk-${{ env.SPIN_TAG }}
base: main
base: ${{ env.RELEASE_BRANCH }}
delete-branch: true
committer: fermybot <[email protected]>
author: fermybot <[email protected]>
Expand Down
2 changes: 0 additions & 2 deletions docs/content/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ To cut a major / minor release of Spin, you will need to do the following:

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

PR these changes to the release branch ensuring that pull request has a base corresponding to the release branch (e.g. `v1.1`).
Expand Down Expand Up @@ -62,7 +61,6 @@ $ ./.github/gh-backport.sh <pull-request> <branch-name>
1. Switch to the release branch locally and update versions (e.g. `1.1.0-pre0` could `1.1.1`).
- Bump the version in Spin's `Cargo.toml`
- Update SDK_VERSION in `templates/Makefile`
- Run `make build` so that `Cargo.lock` and other associated files are updated
PR these changes to the release branch ensuring that pull request has a base corresponding to the release branch (e.g. `v1.1`).
Expand Down
6 changes: 3 additions & 3 deletions templates/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
SDK_VERSION ?= v2.0.0-pre0
SDK_VERSION ?= v0.0.0

bump-versions: bump-go-versions bump-rust-versions

bump-go-versions:
@for dir in $$(ls -d *-go) ; do \
cd $$dir/content ; \
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 ; \
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 ; \
sed -i.sed-bak -e 's/{{project-name | snake_case}}/foo/g' go.mod ; \
go mod tidy ; \
sed -i.sed-bak -e 's/foo/{{project-name | snake_case}}/g' go.mod ; \
Expand All @@ -16,7 +16,7 @@ bump-go-versions:
bump-rust-versions:
@for dir in $$(ls -d *-rust) ; do \
cd $$dir/content ; \
sed -i.sed-bak -e 's%"https://github.com/fermyon/spin", tag = "v.*"%"https://github.com/fermyon/spin", tag = "${SDK_VERSION}"%g' Cargo.toml ; \
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 ; \
rm *.sed-bak ; \
cd - 2>&1 >/dev/null ; \
done
2 changes: 1 addition & 1 deletion templates/http-go/content/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/{{project-name | snake_case}}

go 1.17

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

require github.com/julienschmidt/httprouter v1.3.0 // indirect
2 changes: 1 addition & 1 deletion templates/http-rust/content/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ bytes = "1"
# General-purpose crate with common HTTP types.
http = "0.2"
# The Spin SDK.
spin-sdk = { git = "https://github.com/fermyon/spin", tag = "v1.5.1" }
spin-sdk = { git = "https://github.com/fermyon/spin", branch = "main" }

[workspace]
2 changes: 1 addition & 1 deletion templates/redis-go/content/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/{{project-name | snake_case}}

go 1.17

require github.com/fermyon/spin/sdk/go v1.5.1
require github.com/fermyon/spin/sdk/go main
2 changes: 1 addition & 1 deletion templates/redis-rust/content/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ anyhow = "1"
# Crate to simplify working with bytes.
bytes = "1"
# The Spin SDK.
spin-sdk = { git = "https://github.com/fermyon/spin", tag = "v1.5.1" }
spin-sdk = { git = "https://github.com/fermyon/spin", branch = "main" }

[workspace]

0 comments on commit 7daedf5

Please sign in to comment.