Skip to content

Commit 35313f6

Browse files
authored
Merge pull request #32 from axelmarciano/fix/goroutine-leak-s3-body
fix: close S3 response bodies to prevent goroutine leak
2 parents ceb7696 + 0428316 commit 35313f6

6 files changed

Lines changed: 1462 additions & 29 deletions

File tree

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
- uses: actions/setup-go@v5
2626
with:
27-
go-version: 1.23
27+
go-version: 1.24
2828

2929
- name: Check if .env exists or create it
3030
run: |

.github/workflows/release.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,13 @@ permissions:
1111
packages: write
1212

1313
jobs:
14-
checkout:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v3
19-
2014
docker:
2115
runs-on: ubuntu-latest
22-
needs: checkout
2316
env:
2417
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2518
steps:
2619
- name: Checkout code
27-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2821

2922
- name: Set up QEMU
3023
uses: docker/setup-qemu-action@v3
@@ -40,7 +33,7 @@ jobs:
4033
IMAGE_TAG="${GITHUB_REF#refs/tags/}"
4134
REPO="ghcr.io/${{ github.repository_owner }}/expo-open-ota"
4235
43-
echo "🔨 Building Docker image with tag: $IMAGE_TAG"
36+
echo "Building Docker image with tag: $IMAGE_TAG"
4437
docker buildx build \
4538
--platform linux/amd64,linux/arm64 \
4639
-t "$REPO:$IMAGE_TAG" \
@@ -52,26 +45,26 @@ jobs:
5245
run: |
5346
REPO="ghcr.io/${{ github.repository_owner }}/expo-open-ota"
5447
55-
echo "📡 Fetching the latest version tag from GHCR..."
48+
echo "Fetching the latest version tag from GHCR..."
5649
LATEST_TAG=$(gh api "https://api.github.com/users/${{ github.repository_owner }}/packages/container/expo-open-ota/versions?per_page=100" \
5750
--jq '[.[].metadata.container.tags[]] | map(select(test("^v[0-9]+\\.[0-9]+\\.[0-9]+$"))) | sort_by(ltrimstr("v") | split(".") | map(tonumber)) | last' | tr -d '"')
58-
59-
echo "🔍 Latest found version: $LATEST_TAG"
60-
echo "🏷️ Current version: $IMAGE_TAG"
51+
52+
echo "Latest found version: $LATEST_TAG"
53+
echo "Current version: $IMAGE_TAG"
6154
6255
if [ "$LATEST_TAG" = "$IMAGE_TAG" ]; then
63-
echo "$IMAGE_TAG is the latest version. Updating latest tag..."
56+
echo "$IMAGE_TAG is the latest version. Updating latest tag..."
6457
docker buildx imagetools create -t "$REPO:latest" "$REPO:$IMAGE_TAG"
6558
else
66-
echo "ℹ️ $IMAGE_TAG is not the latest version. Skipping latest tag update."
59+
echo "$IMAGE_TAG is not the latest version. Skipping latest tag update."
6760
fi
6861
6962
helm:
7063
runs-on: ubuntu-latest
7164
needs: docker
7265
steps:
7366
- name: Checkout code
74-
uses: actions/checkout@v3
67+
uses: actions/checkout@v4
7568

7669
- name: Update Helm values.yaml
7770
run: |
@@ -88,12 +81,12 @@ jobs:
8881
runs-on: ubuntu-latest
8982
steps:
9083
- name: Checkout code
91-
uses: actions/checkout@v3
84+
uses: actions/checkout@v4
9285

9386
- name: Setup Node.js
9487
uses: actions/setup-node@v4
9588
with:
96-
node-version: "20.x"
89+
node-version: "24.x"
9790
registry-url: "https://registry.npmjs.org"
9891

9992
- name: Publish NPM package
@@ -103,21 +96,27 @@ jobs:
10396
npm ci
10497
npm run build
10598
npm version "$VERSION" --no-git-tag-version
106-
npm publish --access public --provenance
107-
env:
108-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
99+
100+
if echo "$VERSION" | grep -qE '\-(alpha|beta|rc)'; then
101+
NPM_TAG=$(echo "$VERSION" | grep -oE '(alpha|beta|rc)')
102+
echo "Pre-release detected, publishing with --tag $NPM_TAG"
103+
npm publish --access public --provenance --tag "$NPM_TAG"
104+
else
105+
npm publish --access public --provenance
106+
fi
109107
110108
github-release:
111109
runs-on: ubuntu-latest
112110
needs: [helm, npm]
113111
steps:
114112
- name: Checkout code
115-
uses: actions/checkout@v3
113+
uses: actions/checkout@v4
116114

117115
- name: Create GitHub Release
118-
uses: softprops/action-gh-release@v1
116+
uses: softprops/action-gh-release@v2
119117
with:
120118
files: ./charts/*.tgz
119+
prerelease: ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc') }}
121120
body: |
122121
## Changes
123122
- Docker image: `ghcr.io/${{ github.repository_owner }}/expo-open-ota:${{ github.ref_name }}`

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM node:18-alpine AS dashboard-builder
1+
FROM --platform=$BUILDPLATFORM node:24-alpine AS dashboard-builder
22
WORKDIR /app/apps/dashboard
33
COPY apps/dashboard/package.json apps/dashboard/package-lock.json ./
44
RUN npm ci
55
COPY apps/dashboard ./
66
RUN npm run build
77

8-
FROM golang:1.23-alpine AS builder
8+
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder
99
ARG TARGETARCH
1010
WORKDIR /app
1111
COPY go.mod go.sum ./

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module expo-open-ota
22

3-
go 1.23
3+
go 1.24
44

55
require (
66
cloud.google.com/go/storage v1.41.0

0 commit comments

Comments
 (0)