name: CI on: push: pull_request: workflow_dispatch: jobs: check: runs-on: debian-trixie container: image: docker.io/library/node:24-trixie-slim@sha256:366fdef91728b1b7fa18c84fba63b6e79ed77b7e10cc206878e9705da4d7b169 steps: - name: Check out source code uses: https://code.forgejo.org/actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up toolchain uses: https://code.forgejo.org/actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version: '>=1.25.6' - name: Install dependencies run: | apt-get -y update apt-get -y install ca-certificates go install honnef.co/go/tools/cmd/staticcheck@latest - name: Build application run: | go build - name: Run static analysis run: | go vet staticcheck release: # IMPORTANT: This workflow step will not work without the Releases unit enabled! if: ${{ forge.ref == 'refs/heads/main' || startsWith(forge.event.ref, 'refs/tags/v') }} needs: [check] runs-on: debian-trixie container: image: docker.io/library/node:24-trixie-slim@sha256:366fdef91728b1b7fa18c84fba63b6e79ed77b7e10cc206878e9705da4d7b169 steps: - name: Install dependencies run: | apt-get -y update apt-get -y install ca-certificates git - name: Check out source code uses: https://code.forgejo.org/actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 - name: Set up toolchain uses: https://code.forgejo.org/actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version: '>=1.25.6' - name: Build release assets # If you want more platforms to be represented, send a pull request. run: | set -x build() { GOOS=$1 GOARCH=$2 go build -o assets/git-pages-cli.$1-$2$3; } build windows amd64 .exe build windows arm64 .exe build linux amd64 build linux arm64 build darwin arm64 git archive -o assets/git-pages-cli-src.zip --prefix git-pages-cli/ HEAD - name: Create release uses: https://code.forgejo.org/actions/forgejo-release@98265452477dafb3f0f27ba9c462c90b18cb44fd # v2.13.4 with: tag: ${{ startsWith(forge.event.ref, 'refs/tags/v') && forge.ref_name || 'latest' }} release-dir: assets hide-archive-link: true direction: upload override: true prerelease: ${{ !startsWith(forge.event.ref, 'refs/tags/v') }} package: if: ${{ forge.ref == 'refs/heads/main' || startsWith(forge.event.ref, 'refs/tags/v') }} needs: [check] runs-on: debian-trixie container: image: docker.io/library/node:24-trixie-slim@sha256:366fdef91728b1b7fa18c84fba63b6e79ed77b7e10cc206878e9705da4d7b169 steps: - name: Install dependencies run: | apt-get -y update apt-get -y install ca-certificates buildah qemu-user-binfmt - name: Check out source code uses: https://code.forgejo.org/actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Build container run: | printf '[storage]\ndriver="vfs"\nrunroot="/run/containers/storage"\ngraphroot="/var/lib/containers/storage"\n' | tee /etc/containers/storage.conf buildah build --arch=amd64 --tag=container:amd64 buildah build --arch=arm64 --tag=container:arm64 buildah manifest create container container:amd64 container:arm64 env: BUILDAH_ISOLATION: chroot - if: ${{ forge.repository == 'git-pages/git-pages-cli' }} name: Push container to Codeberg run: | buildah login --authfile=/tmp/authfile.json \ -u ${{ vars.PACKAGES_USER }} -p ${{ secrets.PACKAGES_TOKEN }} ${FORGE} buildah manifest push --authfile=/tmp/authfile.json \ --all container "docker://${FORGE}/${{ forge.repository }}:${VER/v/}" env: FORGE: codeberg.org VER: ${{ startsWith(forge.event.ref, 'refs/tags/v') && forge.ref_name || 'latest' }} - if: ${{ forge.repository == 'git-pages/git-pages-cli' }} name: Push container to code.forgejo.org run: | buildah login --authfile=/tmp/authfile.json \ -u ${{ vars.PACKAGES_USER }} -p ${{ secrets.CFO_PACKAGES_TOKEN }} ${FORGE} buildah manifest push --authfile=/tmp/authfile.json \ --all container "docker://${FORGE}/${{ forge.repository }}:${VER/v/}" env: FORGE: code.forgejo.org VER: ${{ startsWith(forge.event.ref, 'refs/tags/v') && forge.ref_name || 'latest' }}