feat: add support for Lua comments in normalizer #15
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| goos: darwin | |
| goarch: arm64 | |
| artifact: ccg-darwin-arm64 | |
| - os: macos-15-intel | |
| goos: darwin | |
| goarch: amd64 | |
| artifact: ccg-darwin-amd64 | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| artifact: ccg-linux-amd64 | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: arm64 | |
| artifact: ccg-linux-arm64 | |
| - os: windows-latest | |
| goos: windows | |
| goarch: amd64 | |
| artifact: ccg-windows-amd64.exe | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| - name: Install cross-compiler (Linux ARM64) | |
| if: matrix.goos == 'linux' && matrix.goarch == 'arm64' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
| - name: Build | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: 1 | |
| shell: bash | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| COMMIT=${GITHUB_SHA::7} | |
| DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) | |
| go build -tags "fts5" -ldflags "-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}" -o ${{ matrix.artifact }} ./cmd/ccg/ | |
| - name: Install UPX (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get install -y upx-ucl | |
| - name: Install UPX (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install upx | |
| - name: Install UPX (Windows) | |
| if: runner.os == 'Windows' | |
| run: choco install upx -y | |
| - name: Compress binary with UPX | |
| continue-on-error: true | |
| shell: bash | |
| run: upx --best --lzma ${{ matrix.artifact }} | |
| - name: Compress (Unix) | |
| if: matrix.goos != 'windows' | |
| run: | | |
| tar czf ${{ matrix.artifact }}.tar.gz ${{ matrix.artifact }} | |
| - name: Compress (Windows) | |
| if: matrix.goos == 'windows' | |
| run: | | |
| Compress-Archive -Path ${{ matrix.artifact }} -DestinationPath ccg-windows-amd64.zip | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: | | |
| *.tar.gz | |
| *.zip | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| artifacts/*.tar.gz | |
| artifacts/*.zip | |
| publish-npm: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Copy README for npm | |
| run: cp README.md npm/README.md | |
| - name: Set version from tag | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| cd npm | |
| npm version $VERSION --no-git-tag-version | |
| - name: Publish to npm | |
| working-directory: npm | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npm publish --access public |