chore(ver): Bump version from v1.1.1 to v1.1.2 #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release & Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| paths: | |
| - 'VERSION' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| check-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.get_version.outputs.version }} | |
| tag_exists: ${{ steps.check_tag.outputs.exists }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get version | |
| id: get_version | |
| run: | | |
| VERSION=$(cat VERSION | tr -d '[:space:]') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Check Tag | |
| id: check_tag | |
| run: | | |
| git fetch --tags | |
| if git rev-parse "v${{ steps.get_version.outputs.version }}" >/dev/null 2>&1; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| build-binaries: | |
| needs: check-version | |
| if: needs.check-version.outputs.tag_exists == 'false' | |
| name: Build ${{ matrix.asset_name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # --- LINUX --- | |
| # Standard Server/Desktop (x86_64) | |
| - os: ubuntu-latest | |
| asset_name: autolinux-linux-x86_64 | |
| goos: linux | |
| goarch: amd64 | |
| # ARM64 (Raspberry Pi 4, AWS Graviton) | |
| - os: ubuntu-latest | |
| asset_name: autolinux-linux-aarch64 | |
| goos: linux | |
| goarch: arm64 | |
| # Android/Termux ARM64 | |
| - os: ubuntu-latest | |
| asset_name: autolinux-android-aarch64 | |
| goos: android | |
| goarch: arm64 | |
| # Android x86_64 (Emulator, ChromeOS) | |
| - os: ubuntu-latest | |
| asset_name: autolinux-android-x86_64 | |
| goos: android | |
| goarch: amd64 | |
| # ARMv7 (Raspberry Pi 2/3) | |
| - os: ubuntu-latest | |
| asset_name: autolinux-linux-armv7 | |
| goos: linux | |
| goarch: arm | |
| goarm: "7" | |
| # Android/Termux ARMv7 | |
| - os: ubuntu-latest | |
| asset_name: autolinux-android-armv7 | |
| goos: android | |
| goarch: arm | |
| goarm: "7" | |
| # --- MACOS --- | |
| # Apple Silicon (M1/M2/M3) | |
| - os: macos-latest | |
| asset_name: autolinux-darwin-aarch64 | |
| goos: darwin | |
| goarch: arm64 | |
| # Intel Mac | |
| - os: macos-latest | |
| asset_name: autolinux-darwin-x86_64 | |
| goos: darwin | |
| goarch: amd64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Install NDK for Android builds | |
| if: matrix.goos == 'android' | |
| run: | | |
| set -e | |
| NDK_VERSION="27c" | |
| cd /tmp | |
| echo "Downloading NDK version ${NDK_VERSION}..." | |
| wget --no-verbose https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux.zip | |
| echo "Extracting NDK..." | |
| unzip -q android-ndk-r${NDK_VERSION}-linux.zip | |
| ANDROID_NDK_HOME=/tmp/android-ndk-r${NDK_VERSION} | |
| TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64 | |
| echo "ANDROID_NDK_HOME=$ANDROID_NDK_HOME" >> $GITHUB_ENV | |
| echo "TOOLCHAIN=$TOOLCHAIN" >> $GITHUB_ENV | |
| if [ "${{ matrix.goarch }}" = "arm64" ]; then | |
| echo "CC=$TOOLCHAIN/bin/aarch64-linux-android21-clang" >> $GITHUB_ENV | |
| echo "CGO_ENABLED=1" >> $GITHUB_ENV | |
| elif [ "${{ matrix.goarch }}" = "amd64" ]; then | |
| echo "CC=$TOOLCHAIN/bin/x86_64-linux-android21-clang" >> $GITHUB_ENV | |
| echo "CGO_ENABLED=1" >> $GITHUB_ENV | |
| elif [ "${{ matrix.goarch }}" = "arm" ]; then | |
| echo "CC=$TOOLCHAIN/bin/armv7a-linux-androideabi21-clang" >> $GITHUB_ENV | |
| echo "CGO_ENABLED=1" >> $GITHUB_ENV | |
| fi | |
| echo "NDK setup complete!" | |
| - name: Build Binary | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| GOARM: ${{ matrix.goarm || '' }} | |
| run: | | |
| mkdir -p build | |
| go build -ldflags="-s -w" -o build/${{ matrix.asset_name }} ./cmd/autolinux | |
| - name: Prepare Asset | |
| shell: bash | |
| run: | | |
| chmod +x build/${{ matrix.asset_name }} | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binary-${{ matrix.asset_name }} | |
| path: build/${{ matrix.asset_name }} | |
| create-release: | |
| needs: [check-version, build-binaries] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: binary-* | |
| merge-multiple: true | |
| path: build | |
| - name: Generate Changelog | |
| uses: orhun/git-cliff-action@v4 | |
| id: git_cliff | |
| with: | |
| config: .github/external/cliff.toml | |
| args: --verbose --unreleased --tag v${{ needs.check-version.outputs.version }} --strip all | |
| env: | |
| OUTPUT: CHANGELOG.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ needs.check-version.outputs.version }} | |
| name: Release ${{ needs.check-version.outputs.version }} | |
| body: ${{ steps.git_cliff.outputs.content }} | |
| files: | | |
| build/autolinux-linux-x86_64 | |
| build/autolinux-linux-aarch64 | |
| build/autolinux-linux-armv7 | |
| build/autolinux-android-aarch64 | |
| build/autolinux-android-x86_64 | |
| build/autolinux-android-armv7 | |
| build/autolinux-darwin-aarch64 | |
| build/autolinux-darwin-x86_64 | |
| draft: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |