Skip to content

fix: add missing step and tool implementations #3

fix: add missing step and tool implementations

fix: add missing step and tool implementations #3

Workflow file for this run

name: Release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.26'
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
- name: Build UI
run: cd ui && npm ci && npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build binaries
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
VERSION=${GITHUB_REF#refs/tags/}
EXT=""
if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi
go build -ldflags "-X github.com/GoCodeAlone/ratchet/internal/version.Version=${VERSION}" \
-o bin/ratchetd-${GOOS}-${GOARCH}${EXT} ./cmd/ratchetd
go build -ldflags "-X github.com/GoCodeAlone/ratchet/internal/version.Version=${VERSION}" \
-o bin/ratchet-${GOOS}-${GOARCH}${EXT} ./cmd/ratchet
- name: Package
run: |
VERSION=${GITHUB_REF#refs/tags/}
GOOS=${{ matrix.goos }}
GOARCH=${{ matrix.goarch }}
ARCHIVE=ratchet-${VERSION}-${GOOS}-${GOARCH}
mkdir -p dist/${ARCHIVE}
cp bin/ratchetd-${GOOS}-${GOARCH}* dist/${ARCHIVE}/ratchetd$([ "$GOOS" = "windows" ] && echo ".exe" || echo "")
cp bin/ratchet-${GOOS}-${GOARCH}* dist/${ARCHIVE}/ratchet$([ "$GOOS" = "windows" ] && echo ".exe" || echo "")
cp -r ui/dist dist/${ARCHIVE}/ui-dist
cp ratchet.yaml dist/${ARCHIVE}/
cp README.md dist/${ARCHIVE}/
cd dist && tar czf ${ARCHIVE}.tar.gz ${ARCHIVE}
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
files: dist/*.tar.gz
ui-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
- run: cd ui && npm ci && npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload UI dist
uses: softprops/action-gh-release@v2
with:
files: ui/dist/**