Bump sqlc-dev/setup-sqlc from 4 to 5 #365
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: Default | |
| on: | |
| push: | |
| branches: [master] | |
| tags: [v*] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| main: | |
| name: Lint / Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install -y libarchive-tools scdoc | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| cache: true | |
| go-version-file: go.mod | |
| - uses: sqlc-dev/setup-sqlc@v5 | |
| with: | |
| sqlc-version: 1.30.0 | |
| - run: go mod download | |
| - run: "[[ -z $(go fmt ./...) ]]" | |
| - run: make | |
| - run: ./modctl init | |
| - run: go test -v ./... | |
| - run: go vet ./... | |
| - uses: dominikh/staticcheck-action@v1 | |
| with: | |
| install-go: false | |
| - run: make modctl.1 | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: build | |
| path: modctl | |
| retention-days: 3 | |
| docker: | |
| name: Publish (docker) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 120 | |
| permissions: | |
| contents: read | |
| needs: [main] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: docker/setup-qemu-action@v4 | |
| - uses: docker/setup-buildx-action@v4 | |
| - uses: docker/metadata-action@v6 | |
| id: docker | |
| with: | |
| images: | | |
| mfinelli/modctl | |
| ghcr.io/mfinelli/modctl | |
| tags: type=semver,pattern={{version}} | |
| - uses: docker/login-action@v4 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - uses: docker/login-action@v4 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GHCR_TOKEN }} | |
| - uses: docker/build-push-action@v7 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| tags: ${{ steps.docker.outputs.tags }} | |
| - uses: peter-evans/dockerhub-description@v5 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| repository: mfinelli/modctl | |
| short-description: ${{ github.event.repository.description }} | |
| publish: | |
| name: Publish (APT / RPM) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| container: | |
| image: ubuntu:noble # glibc floor | |
| needs: [main] | |
| steps: | |
| - run: apt-get update | |
| - run: apt-get upgrade -y | |
| - run: | | |
| apt-get install -y \ | |
| apt-utils \ | |
| binutils-aarch64-linux-gnu \ | |
| build-essential \ | |
| ca-certificates \ | |
| createrepo-c \ | |
| curl \ | |
| debsigs \ | |
| file \ | |
| gcc-aarch64-linux-gnu \ | |
| libarchive-tools \ | |
| rclone \ | |
| rpm \ | |
| scdoc \ | |
| tree \ | |
| unzip | |
| - uses: crazy-max/ghaction-import-gpg@v7 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| cache: true | |
| go-version-file: go.mod | |
| - uses: sqlc-dev/setup-sqlc@v5 | |
| with: | |
| sqlc-version: 1.30.0 | |
| - run: sqlc generate | |
| - run: go install github.com/google/go-licenses/v2@latest | |
| - run: ./pkg/builddeb.bash | |
| - run: ./pkg/buildrpm.bash | |
| - run: ./pkg/publish.bash | |
| env: | |
| CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| RCLONE_CONFIG: ${{ secrets.RCLONE_CONFIG }} | |
| - run: go mod vendor | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: deb | |
| path: pkg/*.deb | |
| retention-days: 1 | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: rpm | |
| path: pkg/rpmbuild/RPMS/**/*.rpm | |
| retention-days: 1 | |
| # we use a ubuntu image here even just for the arch build because when we | |
| # bump the minimum to noble we can unify these two steps (makepkg/packman | |
| # are not in the jammy image but they are in the noble image) | |
| publisharch: | |
| name: Publish (Arch) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| container: | |
| image: ubuntu:noble | |
| needs: [publish] | |
| steps: | |
| - run: apt-get update | |
| - run: apt-get upgrade -y | |
| - run: | | |
| apt-get install -y \ | |
| build-essential \ | |
| ca-certificates \ | |
| curl \ | |
| file \ | |
| gcc-aarch64-linux-gnu \ | |
| libarchive-tools \ | |
| makepkg \ | |
| pacman-package-manager \ | |
| rclone \ | |
| scdoc \ | |
| tree \ | |
| unzip \ | |
| zstd | |
| - uses: crazy-max/ghaction-import-gpg@v7 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| cache: true | |
| go-version-file: go.mod | |
| - uses: sqlc-dev/setup-sqlc@v5 | |
| with: | |
| sqlc-version: 1.30.0 | |
| - run: sqlc generate | |
| - run: go install github.com/google/go-licenses/v2@latest | |
| - run: useradd -m builder | |
| - run: ./pkg/buildarch.bash | |
| - run: ./pkg/publisharch.bash | |
| env: | |
| CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| RCLONE_CONFIG: ${{ secrets.RCLONE_CONFIG }} | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: arch | |
| path: | | |
| pkg/arch/*-aarch64.pkg.tar.zst | |
| pkg/arch/*-aarch64.pkg.tar.zst.sig | |
| pkg/arch/*-x86_64.pkg.tar.zst | |
| pkg/arch/*-x86_64.pkg.tar.zst.sig | |
| retention-days: 1 | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| needs: [main, docker, publish, publisharch] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| cache: true | |
| go-version-file: go.mod | |
| - uses: sqlc-dev/setup-sqlc@v5 | |
| with: | |
| sqlc-version: 1.30.0 | |
| - uses: crazy-max/ghaction-import-gpg@v7 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - run: sudo apt-get update | |
| - run: sudo apt-get upgrade -y | |
| - run: >- | |
| sudo apt-get install -y gcc-aarch64-linux-gnu libarchive-tools scdoc | |
| - run: go install github.com/google/go-licenses/v2@latest | |
| - run: | | |
| gh=https://github.com/yshavit/mdq | |
| artifact=mdq-linux-x64.tar.gz | |
| mkdir -p ~/bin | |
| wget ${gh}/releases/download/v0.9.0/${artifact} | |
| bsdtar xf $artifact -C ~/bin | |
| rm -rf $artifact | |
| - run: >- | |
| echo "version=$(grep -P "^\tVersion:" cmd/root.go | awk -F\" | |
| '{print $2}')" >> $GITHUB_OUTPUT | |
| id: version | |
| - run: | | |
| { | |
| echo 'entry<<EOF' | |
| mdq "# ^v${{ steps.version.outputs.version }}" CHANGELOG.md | \ | |
| perl -0777 -pe 's/^(.*?)\n//s; s/^\s*\n+//; s/\n+\s*$//' | \ | |
| awk '{ print }' | |
| echo EOF | |
| } >> $GITHUB_OUTPUT | |
| id: changelog | |
| - run: ./pkg/release.bash | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: release | |
| path: | | |
| *.tar.zst | |
| *.tar.zst.asc | |
| *.sha256 | |
| *.sha256.asc | |
| retention-days: 1 | |
| - uses: ncipollo/release-action@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| artifacts: modctl*.tar.zst,modctl*.tar.zst.asc,*.sha256,*.sha256.asc | |
| body: ${{ steps.changelog.outputs.entry }} | |
| makeLatest: true |