Archived
feat(ci): add GitHub Actions workflows for CI/CD
Adds automated build, test, and release pipelines: - build.yml: Run tests and build native images on push/PR - release.yml: Build and publish releases on tag push - update-homebrew.yml: Auto-update Homebrew formula on release Also adds CHANGELOG.md for tracking releases. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3f046bfd48
commit
767a941ac3
4 files changed
+300
No files matched your search
@@ -0,0 +1,96 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-native:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
artifact: barn-linux-x64
|
||||
- os: macos-latest
|
||||
artifact: barn-macos-arm64
|
||||
- os: macos-13
|
||||
artifact: barn-macos-x64
|
||||
- os: windows-latest
|
||||
artifact: barn-windows-x64
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up GraalVM
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'graalvm-community'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Build native image (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
mvn package -Pnative -DskipTests -Dspotbugs.skip=true -Dpmd.skip=true -Dcheckstyle.skip=true
|
||||
mv target/barn target/${{ matrix.artifact }}
|
||||
|
||||
- name: Build native image (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
mvn package -Pnative -DskipTests -Dspotbugs.skip=true -Dpmd.skip=true -Dcheckstyle.skip=true
|
||||
mv target/barn.exe target/${{ matrix.artifact }}.exe
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact }}
|
||||
path: target/${{ matrix.artifact }}*
|
||||
|
||||
release:
|
||||
needs: build-native
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts/
|
||||
|
||||
- name: Prepare release files
|
||||
run: |
|
||||
mkdir release
|
||||
find artifacts -type f -exec mv {} release/ \;
|
||||
cd release
|
||||
sha256sum * > SHA256SUMS
|
||||
ls -la
|
||||
|
||||
- name: Extract version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=${GITHUB_REF#refs/tags/v}
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Extract changelog
|
||||
id: changelog
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
if [ -f CHANGELOG.md ]; then
|
||||
sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | head -n -1 > release_notes.md || true
|
||||
fi
|
||||
if [ ! -s release_notes.md ]; then
|
||||
echo "Release $VERSION" > release_notes.md
|
||||
fi
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
body_path: release_notes.md
|
||||
files: release/*
|
||||
draft: false
|
||||
prerelease: ${{ contains(github.ref, '-') }}
|
||||
Reference in new issue
Block a user