diff --git a/.github/workflows/publish-trunk.yaml b/.github/workflows/publish-trunk.yaml new file mode 100644 index 0000000..95cc706 --- /dev/null +++ b/.github/workflows/publish-trunk.yaml @@ -0,0 +1,39 @@ +name: 🚀 Publish Trunk + +on: + push: + branches: + - main + paths: + - 'trunk/**' + pull_request: + branches: + - main + paths: + - 'trunk/**' + +jobs: + build-and-release: + name: 🚀 Build and Release + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v4 + - name: Build Trunk + run: docker build ./trunk -t trunk + shell: bash + - name: Log into Quay + uses: docker/login-action@v2 + with: + registry: ${{ secrets.QUAY_REPOSITORY }} + username: ${{ secrets.QUAY_USER_TEMBO }} + password: ${{ secrets.QUAY_PASSWORD_TEMBO }} + - name: Push to Quay + if: github.ref_name == 'main' + shell: bash + run: | + set -xe + TAG="$(perl -nE '/TRUNK_VER\s*=\s*(.+)/ && do { print $1; exit }' trunk/Dockerfile)" + docker tag $IMAGE_NAME ${{ secrets.QUAY_REPOSITORY }}/trunk:$TAG + docker push $IMAGE_NAME ${{ secrets.QUAY_REPOSITORY }}/trunk:$TAG + docker tag $IMAGE_NAME ${{ secrets.QUAY_REPOSITORY }}/trunk:latest + docker push $IMAGE_NAME ${{ secrets.QUAY_REPOSITORY }}/trunk:latest diff --git a/trunk/Dockerfile b/trunk/Dockerfile new file mode 100644 index 0000000..894e266 --- /dev/null +++ b/trunk/Dockerfile @@ -0,0 +1,8 @@ +# Build trunk. +FROM rust:1.83-bookworm AS build +ARG TRUNK_VER=0.15.10 +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +RUN cargo install --version $TRUNK_VER pg-trunk + +FROM scratch +COPY --from=build /usr/local/cargo/bin/trunk . diff --git a/trunk/README.md b/trunk/README.md new file mode 100644 index 0000000..55dc8f1 --- /dev/null +++ b/trunk/README.md @@ -0,0 +1,19 @@ +
+
+