Skip to content

Commit 3643bbb

Browse files
authored
devel-release and release via github actions (#297)
* devel-release and release via github actions * junk paths during packaging * 1.17.6 * diff naming * clean up tests * cleanup consolidated test * store pointer to AppPool * remove test that was erroneously trying to boot puma under the hood
1 parent ff4e254 commit 3643bbb

File tree

6 files changed

+92
-94
lines changed

6 files changed

+92
-94
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [macos-latest, macos-11.0, ubuntu-latest]
11-
go-version: [1.17.2]
12-
ruby-version: [3.1]
11+
go-version: [1.17.6]
1312

1413
name: ${{ matrix.os }} / go-${{ matrix.go-version }}
1514
steps:
@@ -19,12 +18,12 @@ jobs:
1918

2019
- uses: ruby/setup-ruby@v1
2120
with:
22-
ruby-version: ${{ matrix.ruby-version }}
23-
24-
- uses: actions/checkout@v2
21+
ruby-version: 3
2522

2623
- run: gem install puma
2724

25+
- uses: actions/checkout@v2
26+
2827
- if: contains(matrix.os, 'macos')
2928
run: |
3029
sw_vers
@@ -35,3 +34,36 @@ jobs:
3534
- run: go mod download
3635

3736
- run: go test -v -race -coverprofile=coverage.out -covermode=atomic -timeout=300s ./...
37+
38+
devel-release:
39+
runs-on: macos-latest
40+
needs: test
41+
42+
steps:
43+
- uses: actions/setup-go@v1
44+
with:
45+
go-version: 1.17.6
46+
47+
- run: go install github.com/mitchellh/[email protected]
48+
- run: echo $(go env GOPATH)/bin >> $GITHUB_PATH
49+
50+
- uses: actions/checkout@v2
51+
52+
- run: make release
53+
env:
54+
RELEASE: ${{ env.GITHUB_SHA }}
55+
56+
- uses: actions/upload-artifact@v2
57+
with:
58+
name: puma-dev-${{ env.GITHUB_RUN_NUMBER }}-linux-amd64
59+
path: rel/linux_amd64/puma-dev
60+
61+
- uses: actions/upload-artifact@v2
62+
with:
63+
name: puma-dev-${{ env.GITHUB_RUN_NUMBER }}-darwin-amd64
64+
path: rel/darwin_amd64/puma-dev
65+
66+
- uses: actions/upload-artifact@v2
67+
with:
68+
name: puma-dev-${{ env.GITHUB_RUN_NUMBER }}-darwin-arm64
69+
path: rel/darwin_arm64/puma-dev

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: macos-latest
11+
12+
steps:
13+
- uses: actions/setup-go@v1
14+
with:
15+
go-version: 1.17.6
16+
17+
- run: go install github.com/mitchellh/[email protected]
18+
- run: echo $(go env GOPATH)/bin >> $GITHUB_PATH
19+
20+
- name: get release version
21+
id: get_version
22+
run: echo ::set-output name=RELEASE_VERSION::${GITHUB_REF#refs/tags/v}
23+
24+
- uses: actions/checkout@v2
25+
26+
- run: make release
27+
env:
28+
RELEASE: ${{ steps.get_version.outputs.RELEASE_VERSION }}
29+
30+
- uses: ncipollo/release-action@v1
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
artifacts: "pkg/*"
34+
allowUpdates: true
35+
omitBody: true
36+
prerelease: true
37+
removeArtifacts: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/bin/
22
/pkg/
3+
/rel/
34
/vendor/pkg/
45
/tmp
56
/coverage*.out

Makefile

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,28 @@ install:
1010
lint:
1111
golangci-lint run
1212

13+
1314
release:
15+
rm -rf ./rel
16+
mkdir ./rel
17+
1418
rm -rf ./pkg
15-
mkdir -p ./pkg
19+
mkdir ./pkg
1620

1721
SDKROOT=$$(xcrun --sdk macosx --show-sdk-path) gox -cgo -os="darwin" -arch="amd64 arm64" -ldflags "-X main.Version=$$RELEASE" ./cmd/puma-dev
1822
gox -os="linux" -arch="amd64" -ldflags "-X main.Version=$$RELEASE" ./cmd/puma-dev
1923

20-
# linux
21-
for arch in amd64; do \
22-
mv -v "puma-dev_linux_$$arch" puma-dev; \
23-
tar czvf "pkg/puma-dev-$$RELEASE-linux-$$arch.tar.gz" puma-dev; \
24-
done
25-
26-
# macOS
27-
for arch in amd64 arm64; do \
28-
mv -v "puma-dev_darwin_$$arch" puma-dev; \
29-
zip -v "pkg/puma-dev-$$RELEASE-darwin-$$arch.zip" puma-dev; \
30-
done
24+
mkdir rel/linux_amd64
25+
mv -v puma-dev_linux_amd64 rel/linux_amd64/puma-dev
26+
tar -C rel/linux_amd64 -cvzf "pkg/puma-dev-$$RELEASE-linux-amd64.tar.gz" puma-dev
27+
28+
mkdir rel/darwin_amd64
29+
mv -v puma-dev_darwin_amd64 rel/darwin_amd64/puma-dev
30+
zip -j -v "pkg/puma-dev-$$RELEASE-darwin-amd64.zip" rel/darwin_amd64/puma-dev
31+
32+
mkdir rel/darwin_arm64
33+
mv -v puma-dev_darwin_arm64 rel/darwin_arm64/puma-dev
34+
zip -j -v "pkg/puma-dev-$$RELEASE-darwin-arm64.zip" rel/darwin_arm64/puma-dev
3135

3236
test: clean-test
3337
go test -v -race -coverprofile=coverage.out -covermode=atomic ./...

dev/app.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ func (a *AppPool) maybeIdle(app *App) bool {
451451

452452
var ErrUnknownApp = errors.New("unknown app")
453453

454+
// Find an app by domain name. If the app is not running, launch it.
454455
func (a *AppPool) lookupApp(name string) (*App, error) {
455456
a.lock.Lock()
456457
defer a.lock.Unlock()

dev/app_test.go

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)