From 1c9de3907952d90996a3fcf1b394109fdd342500 Mon Sep 17 00:00:00 2001 From: Stefano Bertelli Date: Mon, 30 Mar 2026 23:32:01 -0500 Subject: [PATCH] chore: add dev branch pipeline for pre-release images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds and pushes docker images on every push to dev branch. Tags based on latest main release: e.g. v1.2.3.dev0, v1.2.3.dev5. No tests — fast feedback loop for testing. --- .forgejo/workflows/dev.yml | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .forgejo/workflows/dev.yml diff --git a/.forgejo/workflows/dev.yml b/.forgejo/workflows/dev.yml new file mode 100644 index 0000000..003673b --- /dev/null +++ b/.forgejo/workflows/dev.yml @@ -0,0 +1,49 @@ +name: Dev + +on: + push: + branches: + - dev + +jobs: + docker: + runs-on: docker + container: + image: catthehacker/ubuntu:act-latest + options: --privileged + steps: + - name: Checkout repository + run: | + git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git -b dev . + git fetch origin main --tags + + - name: Build and push pre-release image + shell: bash + env: + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + run: | + # Derive version from latest tag on main: v1.2.3 -> 1.2.3.dev0, .dev1, etc. + LATEST_TAG=$(git describe --tags --abbrev=0 origin/main 2>/dev/null || echo "v0.0.0") + BASE_VERSION="${LATEST_TAG#v}" + # Count commits on dev since that tag + DEV_N=$(git rev-list --count "${LATEST_TAG}..HEAD" 2>/dev/null || echo "0") + VERSION="${BASE_VERSION}.dev${DEV_N}" + + REGISTRY=$(echo "${{ github.server_url }}" | sed 's|https://||; s|http://||') + IMAGE="${REGISTRY}/${{ github.repository_owner }}/wiregui" + + echo "Building ${IMAGE}:v${VERSION}" + + echo "${REGISTRY_TOKEN}" | docker login "${REGISTRY}" \ + -u "${{ github.repository_owner }}" --password-stdin + + docker build \ + --build-arg "VERSION=${VERSION}" \ + -t "${IMAGE}:v${VERSION}" \ + -t "${IMAGE}:dev" \ + . + + docker push "${IMAGE}:v${VERSION}" + docker push "${IMAGE}:dev" + + echo "Pushed ${IMAGE}:v${VERSION}, ${IMAGE}:dev"