Skip to content

Commit ef391aa

Browse files
committed
chore: update actions
1 parent f6e411e commit ef391aa

File tree

4 files changed

+90
-22
lines changed

4 files changed

+90
-22
lines changed

.github/changelog-config.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,41 @@
1515
{
1616
"title": "## Maintenance",
1717
"labels": ["chore", "dependencies"]
18+
},
19+
{
20+
"title": "## ⚠️ Breaking Changes",
21+
"labels": ["breaking", "breaking-change"]
1822
}
1923
],
2024
"template": "#{{CHANGELOG}}\n\n**Full Changelog**: https://github.com/${{OWNER}}/${{REPO}}/compare/${{FROM_TAG}}...${{TO_TAG}}",
21-
"pr_template": "- #{{TITLE}} (#{{NUMBER}})"
25+
"pr_template": "- #{{TITLE}} (#{{NUMBER}})",
26+
"empty_template": "No changes in this release",
27+
"label_extractor": [
28+
{
29+
"pattern": "^(feat|feature)(\\(.+\\))?:",
30+
"target": "feature"
31+
},
32+
{
33+
"pattern": "^fix(\\(.+\\))?:",
34+
"target": "fix"
35+
},
36+
{
37+
"pattern": "^docs?(\\(.+\\))?:",
38+
"target": "documentation"
39+
},
40+
{
41+
"pattern": "^chore(\\(.+\\))?:",
42+
"target": "chore"
43+
},
44+
{
45+
"pattern": "!:",
46+
"target": "breaking",
47+
"on_property": "title"
48+
},
49+
{
50+
"pattern": "BREAKING CHANGE",
51+
"target": "breaking",
52+
"on_property": "body"
53+
}
54+
]
2255
}

.github/workflows/release-tag.yaml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up Go
3030
uses: actions/setup-go@v4
3131
with:
32-
go-version: '1.24'
32+
go-version: '1.25'
3333
cache: false
3434

3535
- name: Run tests
@@ -39,6 +39,9 @@ jobs:
3939
name: Build and Publish
4040
needs: test
4141
runs-on: ubuntu-latest
42+
outputs:
43+
version: ${{ steps.get_version.outputs.version }}
44+
changelog: ${{ steps.changelog.outputs.changelog }}
4245
steps:
4346
- name: Checkout code
4447
uses: actions/checkout@v4
@@ -51,9 +54,23 @@ jobs:
5154
# If triggered by a tag push, use the tag name.
5255
# If triggered manually, use the input version.
5356
if [[ "${{ github.event_name }}" == "push" ]]; then
54-
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
57+
VERSION="${{ github.ref_name }}"
5558
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
56-
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
59+
VERSION="${{ inputs.version }}"
60+
fi
61+
echo "VERSION=$VERSION" >> $GITHUB_ENV
62+
echo "version=$VERSION" >> $GITHUB_OUTPUT
63+
64+
- name: Get Previous Tag
65+
id: get_previous_tag
66+
run: |
67+
PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -v "^${{ env.VERSION }}$" | head -n 1)
68+
if [[ -z "$PREVIOUS_TAG" ]]; then
69+
echo "PREVIOUS_TAG=" >> $GITHUB_OUTPUT
70+
echo "No previous tag found"
71+
else
72+
echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
73+
echo "Previous tag: $PREVIOUS_TAG"
5774
fi
5875
5976
- name: Generate Changelog
@@ -62,8 +79,9 @@ jobs:
6279
with:
6380
mode: "HYBRID"
6481
configuration: ".github/changelog-config.json"
65-
fromTag: ${{ env.PREVIOUS_TAG }}
82+
fromTag: ${{ steps.get_previous_tag.outputs.PREVIOUS_TAG }}
6683
toTag: ${{ env.VERSION }}
84+
failOnError: false
6785
env:
6886
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6987

@@ -125,7 +143,7 @@ jobs:
125143
GOOS=$GOOS GOARCH=$GOARCH go build -ldflags="-s -w -X 'github.com/haloydev/haloy/internal/constants.Version=${{ env.VERSION }}'" -o "dist/$OUTPUT_NAME" ./cmd/haloy
126144
done
127145
128-
# haloyadm - Linux only (server administration tool)
146+
# haloyadm CLI - server administration tool (typically used on Linux servers)
129147
HALOYADM_PLATFORMS=("linux/amd64" "linux/arm64")
130148
131149
for platform in "${HALOYADM_PLATFORMS[@]}"; do
@@ -155,13 +173,6 @@ jobs:
155173
needs: build-and-publish
156174
runs-on: ubuntu-latest
157175
steps:
158-
- name: Determine Version
159-
run: |
160-
if [[ "${{ github.event_name }}" == "push" ]]; then
161-
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
162-
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
163-
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
164-
fi
165176
- name: Download artifacts
166177
uses: actions/download-artifact@v4
167178
with:
@@ -171,7 +182,8 @@ jobs:
171182
- name: Create or Update Release
172183
uses: softprops/action-gh-release@v1
173184
with:
174-
tag_name: ${{ env.VERSION }}
185+
tag_name: ${{ needs.build-and-publish.outputs.version }}
186+
body: ${{ needs.build-and-publish.outputs.changelog }}
175187
files: |
176188
dist/haloy-linux-amd64
177189
dist/haloy-linux-arm64
@@ -183,6 +195,6 @@ jobs:
183195
dist/haloyadm-linux-arm64
184196
dist/checksums.txt
185197
draft: false
186-
prerelease: ${{ contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta') || contains(env.VERSION, 'rc') }}
198+
prerelease: ${{ contains(needs.build-and-publish.outputs.version, 'alpha') || contains(needs.build-and-publish.outputs.version, 'beta') || contains(needs.build-and-publish.outputs.version, 'rc') }}
187199
env:
188200
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v4
1919
with:
20-
go-version: '1.24'
20+
go-version: '1.25'
2121
cache: false
2222

2323
- name: Install gofumpt

.github/workflows/update-homebrew.yaml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,49 @@ jobs:
2020
echo "VERSION_NO_V=$VERSION_NO_V" >> $GITHUB_ENV
2121
echo "Updating to version: $VERSION ($VERSION_NO_V)"
2222
23+
- name: Wait for release assets
24+
run: |
25+
echo "Waiting 30 seconds for release assets to be fully uploaded..."
26+
sleep 30
27+
2328
- name: Download release assets
2429
run: |
2530
mkdir -p dist
2631
cd dist
2732
28-
# Download the checksums file
29-
curl -L -o checksums.txt \
30-
"https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/checksums.txt"
33+
# Download the checksums file with retry logic
34+
MAX_RETRIES=5
35+
RETRY_COUNT=0
36+
37+
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
38+
if curl -f -L -o checksums.txt \
39+
"https://github.com/${{ github.repository }}/releases/download/${{ env.VERSION }}/checksums.txt"; then
40+
echo "Successfully downloaded checksums.txt"
41+
break
42+
fi
43+
44+
RETRY_COUNT=$((RETRY_COUNT + 1))
45+
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
46+
echo "Download failed, retrying in 10 seconds... (Attempt $RETRY_COUNT/$MAX_RETRIES)"
47+
sleep 10
48+
else
49+
echo "Failed to download checksums.txt after $MAX_RETRIES attempts"
50+
exit 1
51+
fi
52+
done
3153
3254
cat checksums.txt
3355
3456
- name: Extract checksums
3557
id: checksums
3658
run: |
37-
ARM64_SHA=$(grep "haloy-darwin-arm64$" dist/checksums.txt | awk '{print $1}')
38-
AMD64_SHA=$(grep "haloy-darwin-amd64$" dist/checksums.txt | awk '{print $1}')
59+
ARM64_SHA=$(grep -E "^[a-f0-9]+[[:space:]]+haloy-darwin-arm64$" dist/checksums.txt | awk '{print $1}')
60+
AMD64_SHA=$(grep -E "^[a-f0-9]+[[:space:]]+haloy-darwin-amd64$" dist/checksums.txt | awk '{print $1}')
3961
4062
if [[ -z "$ARM64_SHA" || -z "$AMD64_SHA" ]]; then
4163
echo "Error: Could not extract checksums"
64+
echo "Contents of checksums.txt:"
65+
cat dist/checksums.txt
4266
exit 1
4367
fi
4468
@@ -81,4 +105,3 @@ jobs:
81105
git add haloy.rb
82106
git commit -m "Update haloy to ${{ env.VERSION }}"
83107
git push
84-

0 commit comments

Comments
 (0)