docs: update specs and readme with navigation and profile features #18
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: | |
| branches: | |
| - main | |
| - dev | |
| tags: | |
| - 'v*' | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25' | |
| cache: true | |
| - name: Set Release Info | |
| id: info | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
| echo "suffix=" >> $GITHUB_OUTPUT | |
| echo "is_tag=true" >> $GITHUB_OUTPUT | |
| elif [[ "${GITHUB_REF}" == refs/heads/main ]]; then | |
| echo "version=unstable-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "suffix=-unstable" >> $GITHUB_OUTPUT | |
| echo "is_tag=false" >> $GITHUB_OUTPUT | |
| elif [[ "${GITHUB_REF}" == refs/heads/dev ]]; then | |
| echo "version=dev-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "suffix=-dev" >> $GITHUB_OUTPUT | |
| echo "is_tag=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=latest" >> $GITHUB_OUTPUT | |
| echo "suffix=" >> $GITHUB_OUTPUT | |
| echo "is_tag=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build Binaries | |
| run: | | |
| mkdir -p bin | |
| VERSION=${{ steps.info.outputs.version }} | |
| SUFFIX=${{ steps.info.outputs.suffix }} | |
| # Linux amd64 | |
| GOOS=linux GOARCH=amd64 go build -ldflags "-X main.Version=$VERSION" -o bin/zaplab-linux-amd64$SUFFIX . | |
| # Linux arm64 | |
| GOOS=linux GOARCH=arm64 go build -ldflags "-X main.Version=$VERSION" -o bin/zaplab-linux-arm64$SUFFIX . | |
| # Darwin amd64 (macOS) | |
| GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.Version=$VERSION" -o bin/zaplab-darwin-amd64$SUFFIX . | |
| # Darwin arm64 (macOS Apple Silicon) | |
| GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.Version=$VERSION" -o bin/zaplab-darwin-arm64$SUFFIX . | |
| # Windows amd64 | |
| GOOS=windows GOARCH=amd64 go build -ldflags "-X main.Version=$VERSION" -o bin/zaplab-windows-amd64$SUFFIX.exe . | |
| - name: Upload Artifacts (dev/unstable) | |
| if: steps.info.outputs.is_tag == 'false' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zaplab-binaries-${{ steps.info.outputs.version }} | |
| path: bin/ | |
| retention-days: 7 | |
| - name: Create GitHub Release (Tags only) | |
| if: steps.info.outputs.is_tag == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| bin/zaplab-linux-amd64 | |
| bin/zaplab-linux-arm64 | |
| bin/zaplab-darwin-amd64 | |
| bin/zaplab-darwin-arm64 | |
| bin/zaplab-windows-amd64.exe | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ${{ secrets.DOCKERHUB_USERNAME }}/zaplab | |
| ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern=latest | |
| type=sha | |
| type=raw,value=unstable,enable=${{ github.ref == 'refs/heads/main' }} | |
| type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |