@@ -11,20 +11,13 @@ permissions:
1111 packages : write
1212
1313jobs :
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
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 }}`
0 commit comments