Skip to content

v0.1.1

v0.1.1 #14

Workflow file for this run

name: Release
on:
release:
types: [created]
permissions:
contents: write
defaults:
run:
shell: bash
jobs:
release:
name: Create Release
runs-on: 'ubuntu-latest'
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Get OS and arch info
run: |
BINARY_NAME=nuwa-terminal-${{ matrix.goos }}-${{ matrix.goarch }}
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
echo "GOOS=${{ matrix.goos }}" >> $GITHUB_ENV
echo "GOARCH=${{ matrix.goarch }}" >> $GITHUB_ENV
- name: Build
run: |
go build -o "$BINARY_NAME" -v ./cmd
- name: Generate Release Notes
run: |
# Create temp file for changes
if ! git describe --tags --abbrev=0 2>/dev/null; then
git log --pretty='format:* %h %s%n * %an <%ae>' --no-merges > changes.tmp
else
git log $(git describe --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n * %an <%ae>' --no-merges > changes.tmp
fi
# Replace placeholder with actual changes
sed '/\[Changes will be automatically inserted here by the release workflow\]/r changes.tmp' .github/RELEASE-TEMPLATE.md > RELEASE-NOTES.md
rm changes.tmp
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: "RELEASE-NOTES.md"
files: |
${{ env.BINARY_NAME }}
install.sh
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}