-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
10 changed files
with
234 additions
and
5 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
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,28 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
make: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Sage | ||
uses: einride/sage/actions/setup@master | ||
with: | ||
go-version: "1.20" | ||
|
||
- name: Make | ||
run: make | ||
|
||
- name: Dry-run semantic-release | ||
run: make semantic-release repo=${{ github.repository }} dry=true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Dry-run GoReleaser | ||
run: make go-releaser snapshot=true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,29 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Sage | ||
uses: einride/sage/actions/setup@master | ||
with: | ||
go-version: "1.20" | ||
|
||
- name: Make | ||
run: make | ||
|
||
- name: Run semantic-release | ||
run: make semantic-release repo=${{ github.repository }} dry=false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run GoReleaser | ||
run: make go-releaser snapshot=false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,25 @@ | ||
before: | ||
hooks: | ||
- go mod download | ||
|
||
builds: | ||
- id: backstage | ||
binary: backstage | ||
dir: ./cmd/backstage | ||
main: main.go | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
|
||
release: | ||
github: | ||
prerelease: auto |
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,21 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
"go.einride.tech/sage/sg" | ||
) | ||
|
||
type CmdBackstage sg.Namespace | ||
|
||
func (CmdBackstage) Default(ctx context.Context) error { | ||
sg.Deps(ctx, CmdBackstage.GoModTidy) | ||
return nil | ||
} | ||
|
||
func (CmdBackstage) GoModTidy(ctx context.Context) error { | ||
sg.Logger(ctx).Println("tidying Go module files...") | ||
cmd := sg.Command(ctx, "go", "mod", "tidy", "-v") | ||
cmd.Dir = sg.FromGitRoot("cmd", "backstage") | ||
return cmd.Run() | ||
} |
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
go.einride.tech/sage v0.212.0 h1:0v5rBRBA/v1lX4hxf0EDSOhPDi366VXAybxh4Rhqu7w= | ||
go.einride.tech/sage v0.212.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ= | ||
go.einride.tech/sage v0.212.1 h1:RMJ61K2nQZyNjljhE5/cREpRjwuM5rLD3BbhOLheqbM= | ||
go.einride.tech/sage v0.212.1/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ= |
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
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
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,52 @@ | ||
# Code generated by go.einride.tech/sage. DO NOT EDIT. | ||
# To learn more, see ../../.sage/main.go and https://github.com/einride/sage. | ||
|
||
.DEFAULT_GOAL := default | ||
|
||
cwd := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) | ||
sagefile := $(abspath $(cwd)/../../.sage/bin/sagefile) | ||
|
||
# Setup Go. | ||
go := $(shell command -v go 2>/dev/null) | ||
export GOWORK ?= off | ||
ifndef go | ||
SAGE_GO_VERSION ?= 1.18.4 | ||
export GOROOT := $(abspath $(cwd)/../../.sage/tools/go/$(SAGE_GO_VERSION)/go) | ||
export PATH := $(PATH):$(GOROOT)/bin | ||
go := $(GOROOT)/bin/go | ||
os := $(shell uname | tr '[:upper:]' '[:lower:]') | ||
arch := $(shell uname -m) | ||
ifeq ($(arch),x86_64) | ||
arch := amd64 | ||
endif | ||
$(go): | ||
$(info installing Go $(SAGE_GO_VERSION)...) | ||
@mkdir -p $(dir $(GOROOT)) | ||
@curl -sSL https://go.dev/dl/go$(SAGE_GO_VERSION).$(os)-$(arch).tar.gz | tar xz -C $(dir $(GOROOT)) | ||
@touch $(GOROOT)/go.mod | ||
@chmod +x $(go) | ||
endif | ||
|
||
.PHONY: $(sagefile) | ||
$(sagefile): $(go) | ||
@cd ../../.sage && $(go) mod tidy && $(go) run . | ||
|
||
.PHONY: sage | ||
sage: | ||
@$(MAKE) $(sagefile) | ||
|
||
.PHONY: update-sage | ||
update-sage: $(go) | ||
@cd ../../.sage && $(go) get -d go.einride.tech/sage@latest && $(go) mod tidy && $(go) run . | ||
|
||
.PHONY: clean-sage | ||
clean-sage: | ||
@git clean -fdx ../../.sage/tools ../../.sage/bin ../../.sage/build | ||
|
||
.PHONY: default | ||
default: $(sagefile) | ||
@$(sagefile) CmdBackstage:Default | ||
|
||
.PHONY: go-mod-tidy | ||
go-mod-tidy: $(sagefile) | ||
@$(sagefile) CmdBackstage:GoModTidy |