mirror of
https://github.com/Alexandre1a/GoSH.git
synced 2026-03-09 19:19:46 +01:00
Update go.yml
Fixed the indentation, and added a release overview
This commit is contained in:
parent
c882c891d4
commit
8be9ac9e82
46
.github/workflows/go.yml
vendored
46
.github/workflows/go.yml
vendored
@ -37,20 +37,19 @@ jobs:
|
||||
- name: Build binaries for multiple architectures
|
||||
run: |
|
||||
mkdir -p dist
|
||||
|
||||
# Linux
|
||||
# Linux
|
||||
GOOS=linux GOARCH=amd64 go build -o dist/gosh-linux-amd64
|
||||
GOOS=linux GOARCH=arm64 go build -o dist/gosh-linux-arm64
|
||||
# macOS
|
||||
GOOS=darwin GOARCH=amd64 go build -o dist/gosh-mac-amd64
|
||||
GOOS=darwin GOARCH=arm64 go build -o dist/gosh-mac-arm64
|
||||
|
||||
ls -lh dist/
|
||||
|
||||
# Windows
|
||||
# GOOS=windows GOARCH=amd64 go build -o dist/gosh-windows-amd64.exe
|
||||
# GOOS=windows GOARCH=arm64 go build -o dist/gosh-windows-arm64.exe
|
||||
|
||||
# macOS
|
||||
GOOS=darwin GOARCH=amd64 go build -o dist/gosh-mac-amd64
|
||||
GOOS=darwin GOARCH=arm64 go build -o dist/gosh-mac-arm64
|
||||
|
||||
ls -lh dist/
|
||||
|
||||
- name: Upload binaries as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
@ -71,6 +70,39 @@ jobs:
|
||||
name: gosh-binaries
|
||||
path: dist/
|
||||
|
||||
- name: Generate Changelog
|
||||
id: changelog
|
||||
run: |
|
||||
CURRENT_TAG=${GITHUB_REF#refs/tags/}
|
||||
# Get all tags sorted by version (descending)
|
||||
ALL_TAGS=$(git tag --sort=-version:refname)
|
||||
PREVIOUS_TAG=""
|
||||
found_current=0
|
||||
# Find the tag immediately before the current one
|
||||
for tag in $ALL_TAGS; do
|
||||
if [ "$found_current" -eq 1 ]; then
|
||||
PREVIOUS_TAG=$tag
|
||||
break
|
||||
fi
|
||||
if [ "$tag" == "$CURRENT_TAG" ]; then
|
||||
found_current=1
|
||||
fi
|
||||
done
|
||||
# Fallback to initial commit if no previous tag
|
||||
if [ -z "$PREVIOUS_TAG" ]; then
|
||||
PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
|
||||
fi
|
||||
# Generate changelog
|
||||
CHANGELOG=$(git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..$CURRENT_TAG)
|
||||
if [ -z "$CHANGELOG" ]; then
|
||||
CHANGELOG="No changes since previous release."
|
||||
fi
|
||||
# Output for GitHub Action
|
||||
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user