Skip to content

Commit

Permalink
Move K3s release cmds (#349)
Browse files Browse the repository at this point in the history
* move create tags to release command

* move modify_k3s command to release command

* fix run templated script references

* add release push k3s command

* remove k3s_release command

* remove k3s_release command

* add release command to release action

* update push command and readme

* remove logrus

* update k3s references command

* fix workspace reference

* add config examples

* remove Release struct

---------

Co-authored-by: Pedro Tashima <[email protected]>
  • Loading branch information
tashima42 and tashima42 authored Jan 29, 2024
1 parent 1a25f85 commit 4be7497
Show file tree
Hide file tree
Showing 17 changed files with 398 additions and 553 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ jobs:
${{ github.workspace }}/cmd/backport/bin/backport-linux-amd64
${{ github.workspace }}/cmd/backport/bin/backport-linux-arm64
${{ github.workspace }}/cmd/backport/bin/sha256sums-backport.txt
${{ github.workspace }}/cmd/release/bin/release-darwin-amd64
${{ github.workspace }}/cmd/release/bin/release-darwin-arm64
${{ github.workspace }}/cmd/release/bin/release-freebsd-amd64
${{ github.workspace }}/cmd/release/bin/release-freebsd-arm64
${{ github.workspace }}/cmd/release/bin/release-linux-amd64
${{ github.workspace }}/cmd/release/bin/release-linux-arm64
${{ github.workspace }}/cmd/release/bin/sha256sums-release.txt
${{ github.workspace }}/cmd/gen_release_notes/bin/gen_release_notes-darwin-amd64
${{ github.workspace }}/cmd/gen_release_notes/bin/gen_release_notes-darwin-arm64
${{ github.workspace }}/cmd/gen_release_notes/bin/gen_release_notes-freebsd-amd64
Expand All @@ -56,13 +63,6 @@ jobs:
${{ github.workspace }}/cmd/gen_release_report/bin/gen_release_report-linux-amd64
${{ github.workspace }}/cmd/gen_release_report/bin/gen_release_report-linux-arm64
${{ github.workspace }}/cmd/gen_release_report/bin/sha256sums-gen_release_report.txt
${{ github.workspace }}/cmd/k3s_release/bin/k3s_release-darwin-amd64
${{ github.workspace }}/cmd/k3s_release/bin/k3s_release-darwin-arm64
${{ github.workspace }}/cmd/k3s_release/bin/k3s_release-freebsd-amd64
${{ github.workspace }}/cmd/k3s_release/bin/k3s_release-freebsd-arm64
${{ github.workspace }}/cmd/k3s_release/bin/k3s_release-linux-amd64
${{ github.workspace }}/cmd/k3s_release/bin/k3s_release-linux-arm64
${{ github.workspace }}/cmd/k3s_release/bin/sha256sums-k3s_release.txt
${{ github.workspace }}/cmd/rancher_release/bin/rancher_release-darwin-amd64
${{ github.workspace }}/cmd/rancher_release/bin/rancher_release-darwin-arm64
${{ github.workspace }}/cmd/rancher_release/bin/rancher_release-freebsd-amd64
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ gen_release_notes:
gen_release_report:
cd cmd/$@ && $(MAKE)

.PHONY: k3s_release
k3s_release:
cd cmd/$@ && $(MAKE)

.PHONY: rancher_release
rancher_release:
cd cmd/$@ && $(MAKE)
Expand Down
2 changes: 1 addition & 1 deletion cmd/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BINARIES = gen_release_notes gen_release_report backport semv k3s_release rancher_release test_coverage upstream_go_version rke2_release release
BINARIES = gen_release_notes gen_release_report backport semv rancher_release test_coverage upstream_go_version rke2_release release
ARCHS ?= amd64 arm64
OSs ?= linux darwin freebsd
GO_COMPILE = GOOS=$${os} GOARCH=$${arch} CGO_ENABLED=1 $(GO) build -tags $(TAGS) -v -ldflags "$(LDFLAGS)" -o $@-$${os}-$${arch}
Expand Down
24 changes: 0 additions & 24 deletions cmd/k3s_release/Makefile

This file was deleted.

69 changes: 0 additions & 69 deletions cmd/k3s_release/README.md

This file was deleted.

64 changes: 0 additions & 64 deletions cmd/k3s_release/create_tags.go

This file was deleted.

39 changes: 0 additions & 39 deletions cmd/k3s_release/main.go

This file was deleted.

49 changes: 0 additions & 49 deletions cmd/k3s_release/modify_k3s.go

This file was deleted.

48 changes: 0 additions & 48 deletions cmd/k3s_release/push_tags.go

This file was deleted.

21 changes: 18 additions & 3 deletions cmd/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,24 @@ release -h

#### Commands
```bash
# [...]
release k3s tag rc v1.29.2
release k3s tag ga v1.29.2
release generate k3s tags v1.29.2
release push k3s tags v1.29.2
release update k3s references v1.29.2
release tag k3s rc v1.29.2
release tag k3s ga v1.29.2
```

#### Cache Permissions and Docker:
```bash
$ release generate k3s tags v1.26.12
> failed to rebase and create tags: chown: changing ownership of '/home/go/.cache': Operation not permitted
failed to initialize build cache at /home/go/.cache: mkdir /home/go/.cache/00: permission denied
```
Verify if the `$GOPATH/.cache` directory is owned by the same user that is running the command. If not, change the ownership of the directory:
```bash
$ ls -la $GOPATH/
> drwxr-xr-x 2 root root 4096 Dec 20 15:50 .cache
$ sudo chown $USER $GOPATH/.cache
```


Expand Down
Loading

0 comments on commit 4be7497

Please sign in to comment.