-
Notifications
You must be signed in to change notification settings - Fork 2
Dev #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev #35
Changes from 62 commits
f09f9f9
04765b6
f95f705
22d516a
ef595c2
83f6a8e
3804a90
b5700aa
1c00472
a64e349
d2dd113
8f33c2c
cd9c132
59e3a7d
aaf2208
e616e05
b020927
2aec5b1
69ed0c6
595d2c0
954d76c
4f38817
db0511f
699d256
327e999
9c9405a
6628c9d
12698ac
0df599a
ac26496
c579a3e
d3c38a2
3a6cb0b
156ce53
33e14cd
813aed6
609544b
657c79c
959edf4
6d73a98
944ec63
557e4a5
816eb0f
5f8713b
3f6481f
b068104
61bd400
3b8c825
eb65308
a4ebdcb
f78ab77
27a8e24
f8a9519
f23128a
98a0d63
269376f
f3a834d
3018393
4592326
2daa6d2
f8a8e73
4fd8dd0
3201d6a
ada5296
48da57c
d2db2e9
5e91d69
fede229
e01e36d
dd240ba
4478f2b
977b900
b8ee347
8435004
1f91f50
918cfa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| workflow_dispatch: | ||
|
Comment on lines
3
to
7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: git ls-files ".github/workflows/*.yml"Repository: FROSTR-ORG/igloo-server Length of output: 154 🏁 Script executed: cat -n ".github/workflows/release.yml"Repository: FROSTR-ORG/igloo-server Length of output: 7399 Don't trigger release workflow on every push to master without versioning changes. Every push to 🤖 Prompt for AI Agents |
||
| inputs: | ||
| version: | ||
|
|
@@ -13,7 +11,7 @@ on: | |
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' | ||
| if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' | ||
|
AustinKelsay marked this conversation as resolved.
Outdated
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
@@ -31,7 +29,7 @@ jobs: | |
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| bun-version: 1.3.10 | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen-lockfile | ||
|
|
@@ -73,6 +71,12 @@ jobs: | |
| echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT | ||
| echo "version_number=${NEW_VERSION#v}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Type check | ||
| run: bun run tsc --noEmit | ||
|
|
||
| - name: Run test suite | ||
| run: bun test | ||
|
|
||
| - name: Build application | ||
| run: bun run build | ||
|
|
||
|
|
@@ -83,25 +87,56 @@ jobs: | |
| echo "# CHANGELOG" > CHANGELOG.md | ||
| echo "" >> CHANGELOG.md | ||
| fi | ||
| # Add new version entry | ||
|
|
||
| VERSION="${{ steps.new_version.outputs.version_number }}" | ||
| DATE=$(date +%Y-%m-%d) | ||
| sed -i "3i\\## [${{ steps.new_version.outputs.version_number }}] - $DATE\\n" CHANGELOG.md | ||
|
|
||
| # Add commit messages since last tag | ||
| if ! grep -Fq "## [${VERSION}]" CHANGELOG.md; then | ||
| awk -v version="$VERSION" -v date="$DATE" ' | ||
| NR == 1 { print; print ""; print "## [" version "] - " date; print ""; next } | ||
| { print } | ||
| ' CHANGELOG.md > CHANGELOG.md.tmp | ||
| mv CHANGELOG.md.tmp CHANGELOG.md | ||
| fi | ||
|
|
||
| temp_changelog="$(mktemp)" | ||
|
|
||
| # Add commit messages since last tag (safe for special chars in subjects) | ||
| LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | ||
| if [ -n "$LAST_TAG" ]; then | ||
| echo "### Changes since $LAST_TAG:" >> temp_changelog.md | ||
| git log --pretty=format:"- %s" $LAST_TAG..HEAD >> temp_changelog.md | ||
| printf '### Changes since %s:\n' "$LAST_TAG" > "$temp_changelog" | ||
| git log --pretty=format:'%s%x00' "$LAST_TAG..HEAD" \ | ||
| | tr '\0' '\n' \ | ||
| | awk 'NF { print "- " $0 }' >> "$temp_changelog" | ||
| else | ||
| echo "### Changes:" >> temp_changelog.md | ||
| git log --pretty=format:"- %s" -n 10 >> temp_changelog.md | ||
| printf '### Changes:\n' > "$temp_changelog" | ||
| git log --pretty=format:'%s%x00' -n 10 \ | ||
| | tr '\0' '\n' \ | ||
| | awk 'NF { print "- " $0 }' >> "$temp_changelog" | ||
| fi | ||
| printf '\n' >> "$temp_changelog" | ||
|
|
||
| # Insert changes into changelog after the current version heading | ||
| awk -v target="## [${VERSION}]" -v insert_file="$temp_changelog" ' | ||
| { print } | ||
| $0 == target && !inserted { | ||
| while ((getline line < insert_file) > 0) print line | ||
| close(insert_file) | ||
|
AustinKelsay marked this conversation as resolved.
Outdated
|
||
| inserted = 1 | ||
| } | ||
| ' CHANGELOG.md > CHANGELOG.md.tmp | ||
| mv CHANGELOG.md.tmp CHANGELOG.md | ||
| rm -f "$temp_changelog" | ||
|
|
||
| - name: Commit release metadata | ||
| run: | | ||
| TAG="${{ steps.new_version.outputs.new_version }}" | ||
| git add package.json bun.lock CHANGELOG.md | ||
| if git diff --cached --quiet; then | ||
| echo "No release metadata changes to commit" | ||
| else | ||
| git commit -m "chore(release): ${TAG}" | ||
| git push origin HEAD:${GITHUB_REF_NAME} | ||
| fi | ||
| echo "" >> temp_changelog.md | ||
|
|
||
| # Insert changes into changelog | ||
| sed -i "/## \[${{ steps.new_version.outputs.version_number }}\]/r temp_changelog.md" CHANGELOG.md | ||
| rm temp_changelog.md | ||
|
|
||
| - name: Create release archive | ||
| run: | | ||
|
|
@@ -122,28 +157,30 @@ jobs: | |
| --exclude=.git \ | ||
| --exclude=release \ | ||
| --exclude=frontend \ | ||
| src static package.json bun.lock tsconfig.json dockerfile compose.yml README.md LICENSE | ||
| src static package.json bun.lock tsconfig.json Dockerfile compose.yml README.md LICENSE | ||
|
|
||
| - name: Create release tag | ||
| run: | | ||
| # Create git tag for release (works with branch protection) | ||
| # Note: Version changes are not committed back to master due to branch protection | ||
| # The release archives will contain the correct versions | ||
| git tag ${{ steps.new_version.outputs.new_version }} | ||
| git push origin ${{ steps.new_version.outputs.new_version }} | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: actions/create-release@v1 | ||
| id: create_release | ||
| TAG="${{ steps.new_version.outputs.new_version }}" | ||
| git fetch --tags origin | ||
| if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then | ||
| echo "Tag ${TAG} already exists, skipping tag creation" | ||
| else | ||
| git tag "${TAG}" | ||
| git push origin "${TAG}" | ||
| fi | ||
|
AustinKelsay marked this conversation as resolved.
|
||
|
|
||
| - name: Create GitHub release and upload assets | ||
| uses: softprops/action-gh-release@v2 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: ${{ steps.new_version.outputs.new_version }} | ||
| release_name: Release ${{ steps.new_version.outputs.new_version }} | ||
| name: Release ${{ steps.new_version.outputs.new_version }} | ||
| body: | | ||
| ## Changes in ${{ steps.new_version.outputs.new_version }} | ||
|
|
||
| See [CHANGELOG.md](https://github.com/FROSTR-ORG/igloo-server/blob/master/CHANGELOG.md) for full details. | ||
| See [CHANGELOG.md](https://github.com/FROSTR-ORG/igloo-server/blob/main/CHANGELOG.md) for full details. | ||
|
|
||
| ### Installation | ||
|
|
||
|
|
@@ -162,36 +199,21 @@ jobs: | |
| ``` | ||
| draft: false | ||
| prerelease: false | ||
|
|
||
| - name: Upload source archive | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
| asset_path: ./release/igloo-server-${{ steps.new_version.outputs.version_number }}-src.tar.gz | ||
| asset_name: igloo-server-${{ steps.new_version.outputs.version_number }}-src.tar.gz | ||
| asset_content_type: application/gzip | ||
|
|
||
| - name: Upload binary archive | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
| asset_path: ./release/igloo-server-${{ steps.new_version.outputs.version_number }}.tar.gz | ||
| asset_name: igloo-server-${{ steps.new_version.outputs.version_number }}.tar.gz | ||
| asset_content_type: application/gzip | ||
| files: | | ||
| ./release/igloo-server-${{ steps.new_version.outputs.version_number }}-src.tar.gz | ||
| ./release/igloo-server-${{ steps.new_version.outputs.version_number }}.tar.gz | ||
|
|
||
| docker: | ||
| runs-on: ubuntu-latest | ||
| needs: release | ||
| permissions: | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: master | ||
| ref: refs/tags/${{ needs.release.outputs.new_version }} | ||
|
Comment on lines
+132
to
+139
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/release.yml | head -160 | tail -50Repository: FROSTR-ORG/igloo-server Length of output: 1977 🏁 Script executed: # Get the full context of the docker job
sed -n '100,150p' .github/workflows/release.ymlRepository: FROSTR-ORG/igloo-server Length of output: 1682 🏁 Script executed: # Check if there are any other permission patterns in the file
grep -n "permissions:" .github/workflows/release.yml -A 3Repository: FROSTR-ORG/igloo-server Length of output: 227 🌐 Web query:
💡 Result:
permissions:
contents: readOtherwise the checkout step can fail because any permission you don’t list is set to Notes:
Citations:
🏁 Script executed: # Check if there are any comments or documentation in the workflow file itself
grep -i "permission\|token\|contents\|read" .github/workflows/release.yml | head -20Repository: FROSTR-ORG/igloo-server Length of output: 438 Restore repository read permission in the Docker job. Job-level 🔧 Minimal fix docker:
runs-on: ubuntu-latest
needs: release
permissions:
+ contents: read
packages: write🤖 Prompt for AI Agents |
||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.