@@ -120,7 +120,7 @@ This release includes Docker images for multiple architectures:
120120
121121# ## GitHub Container Registry (ghcr.io)
122122
123- \`\`\` bash
123+ \`bash
124124# Pull the latest version
125125docker pull ghcr.io/\$REPO_OWNER/loongcollector:latest
126126
@@ -129,18 +129,18 @@ docker pull ghcr.io/\$REPO_OWNER/loongcollector:\$VERSION
129129
130130# Run the container
131131docker run -d --name loongcollector ghcr.io/\$REPO_OWNER/loongcollector:\$VERSION
132- \`\`\`
132+ \`
133133
134134**Supported architectures:**
135135- linux/amd64
136136- linux/arm64
137137
138138# ## Alibaba Cloud Container Registry
139139
140- \`\`\` bash
140+ \`bash
141141# Pull from Alibaba Cloud Container Registry
142142docker pull sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail/loongcollector:\$VERSION
143- \`\`\`
143+ \`
144144
145145**Supported architectures:**
146146- linux/amd64
@@ -150,37 +150,81 @@ docker pull sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail/loongco
150150 echo "$RELEASE_NOTES" > release_notes.md
151151 echo "Release notes generated successfully"
152152
153- - name : Download build artifacts from create-branch workflow
154- uses : actions/download-artifact@v4
155- with :
156- name : loongcollector-${{ github.event.inputs.version }}.linux-amd64.tar.gz
157- path : dist/
158-
159- - name : Download Linux ARM64 artifacts
160- uses : actions/download-artifact@v4
161- with :
162- name : loongcollector-${{ github.event.inputs.version }}.linux-arm64.tar.gz
163- path : dist/
153+ - name : Download build artifacts from OSS
154+ run : |
155+ VERSION="${{ github.event.inputs.version }}"
156+ mkdir -p dist/
157+
158+ # 尝试从 OSS 下载构建产物
159+ echo "Downloading build artifacts from OSS..."
160+
161+ # 下载 Linux AMD64
162+ LINUX_AMD64_URL="https://loongcollector-community-edition.oss-cn-shanghai.aliyuncs.com/${VERSION}/loongcollector-${VERSION}.linux-amd64.tar.gz"
163+ if curl -f -s -o "dist/loongcollector-${VERSION}.linux-amd64.tar.gz" "$LINUX_AMD64_URL"; then
164+ echo "✓ Downloaded Linux AMD64 package"
165+ # 下载对应的 SHA256 文件
166+ curl -f -s -o "dist/loongcollector-${VERSION}.linux-amd64.tar.gz.sha256" "${LINUX_AMD64_URL}.sha256" || echo "SHA256 file not found"
167+ else
168+ echo "✗ Failed to download Linux AMD64 package"
169+ fi
170+
171+ # 下载 Linux ARM64
172+ LINUX_ARM64_URL="https://loongcollector-community-edition.oss-cn-shanghai.aliyuncs.com/${VERSION}/loongcollector-${VERSION}.linux-arm64.tar.gz"
173+ if curl -f -s -o "dist/loongcollector-${VERSION}.linux-arm64.tar.gz" "$LINUX_ARM64_URL"; then
174+ echo "✓ Downloaded Linux ARM64 package"
175+ # 下载对应的 SHA256 文件
176+ curl -f -s -o "dist/loongcollector-${VERSION}.linux-arm64.tar.gz.sha256" "${LINUX_ARM64_URL}.sha256" || echo "SHA256 file not found"
177+ else
178+ echo "✗ Failed to download Linux ARM64 package"
179+ fi
180+
181+ # 下载 Windows
182+ WINDOWS_URL="https://loongcollector-community-edition.oss-cn-shanghai.aliyuncs.com/${VERSION}/loongcollector-${VERSION}.windows-amd64.zip"
183+ if curl -f -s -o "dist/loongcollector-${VERSION}.windows-amd64.zip" "$WINDOWS_URL"; then
184+ echo "✓ Downloaded Windows package"
185+ # 下载对应的 SHA256 文件
186+ curl -f -s -o "dist/loongcollector-${VERSION}.windows-amd64.zip.sha256" "${WINDOWS_URL}.sha256" || echo "SHA256 file not found"
187+ else
188+ echo "✗ Failed to download Windows package"
189+ fi
190+
191+ echo "Downloaded artifacts:"
192+ ls -la dist/ || echo "No artifacts downloaded"
164193
165- - name : Download Windows artifacts
166- uses : actions/download-artifact@v4
167- with :
168- name : loongcollector-${{ github.event.inputs.version }}.windows-amd64.zip
169- path : dist/
194+ - name : Check available artifacts
195+ run : |
196+ echo "Checking available artifacts in dist/ directory:"
197+ ls -la dist/ || echo "No artifacts found in dist/ directory"
198+
199+ if [ ! "$(ls -A dist/ 2>/dev/null)" ]; then
200+ echo "No artifacts found. The release will be created without files."
201+ echo "Make sure the build artifacts have been uploaded to OSS by running publish-create-branch.yaml first."
202+ else
203+ echo "Found artifacts:"
204+ ls -la dist/
205+ fi
170206
171207 - name : Create GitHub Release
172- uses : softprops/action-gh-release@v1
173- with :
174- tag_name : v${{ env.VERSION }}
175- name : Release v${{ env.VERSION }}
176- body_path : release_notes.md
177- draft : false
178- prerelease : false
179- files : |
180- dist/loongcollector-${{ env.VERSION }}.linux-amd64.tar.gz
181- dist/loongcollector-${{ env.VERSION }}.linux-arm64.tar.gz
182- dist/loongcollector-${{ env.VERSION }}.windows-amd64.zip
183- token : ${{ secrets.GITHUB_TOKEN }}
208+ run : |
209+ VERSION="${{ env.VERSION }}"
210+
211+ # 检查是否有可用的 artifacts
212+ if [ "$(ls -A dist/ 2>/dev/null)" ]; then
213+ echo "Found artifacts, creating release with files..."
214+ gh release create "v$VERSION" \
215+ --title "Release v$VERSION" \
216+ --notes-file release_notes.md \
217+ --draft false \
218+ --prerelease false \
219+ dist/*.tar.gz dist/*.zip dist/*.sha256 2>/dev/null || true
220+ else
221+ echo "No artifacts found, creating release without files..."
222+ gh release create "v$VERSION" \
223+ --title "Release v$VERSION" \
224+ --notes-file release_notes.md \
225+ --draft false \
226+ --prerelease false
227+ fi
184228
185229 - name : Output release info
186230 run : |
0 commit comments