mirror of
https://github.com/whyvl/wireproxy.git
synced 2025-04-29 19:01:42 +02:00

* fix: must close the connection after processing I think it should help to close #80 * feat: migration to github.com/things-go/go-socks5 - preallocate config slices - not used interfaces in consumer - do not allocate new variables in loops * feat: close connection after full processing * feat: correct process sigint signal * feat: improve build system * fix: http proxy * feat: update golangci-lint-action to v3.7.0 * feat: correct process routines * fix: close http conn correctly * feat: update golangci-lint-action to v4 * fix: goreleaser used clean now
71 lines
2.4 KiB
YAML
71 lines
2.4 KiB
YAML
name: Build container
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
# Allow for manually running
|
|
workflow_dispatch:
|
|
inputs:
|
|
container_tag:
|
|
description: Tag for container
|
|
default: "latest"
|
|
required: true
|
|
|
|
permissions:
|
|
packages: write
|
|
|
|
jobs:
|
|
container:
|
|
runs-on: ubuntu-20.04
|
|
|
|
env:
|
|
CONTAINER_NAME: ghcr.io/${{ github.repository }}
|
|
BUILD_PLATFORMS: linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x
|
|
RAW_CONTAINER_TAG: ${{ github.event.inputs.container_tag || github.event.pull_request.head.ref || 'latest' }}
|
|
RAW_REF_NAME: ${{ github.event.pull_request.head.ref || github.ref }}
|
|
|
|
steps:
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
# Needed for buildx gha cache to work
|
|
- name: Expose GitHub Runtime
|
|
uses: crazy-max/ghaction-github-runtime@v3
|
|
|
|
- name: Build container
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
CONTAINER_TAG=$(echo "$RAW_CONTAINER_TAG" | sed 's/[^a-zA-Z0-9]\+/-/')
|
|
REF_NAME=$(echo "$RAW_REF_NAME" | sed -r 's#^refs/(heads|tags)/##')
|
|
|
|
docker buildx build \
|
|
--platform "$BUILD_PLATFORMS" \
|
|
--tag "$CONTAINER_NAME:$CONTAINER_TAG" \
|
|
--label "org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}" \
|
|
--label "org.opencontainers.image.documentation=${{ github.server_url }}/${{ github.repository }}" \
|
|
--label "org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }}/packages" \
|
|
--label "org.opencontainers.image.ref.name=$REF_NAME" \
|
|
--label "org.opencontainers.image.revision=${{ github.sha }}" \
|
|
--label "org.opencontainers.image.vendor=${{ github.repository_owner }}" \
|
|
--label "org.opencontainers.image.created=$(date -u --rfc-3339=seconds)" \
|
|
--cache-from type=gha \
|
|
--cache-to type=gha,mode=max \
|
|
--pull ${{ github.event_name == 'push' && '--push' || '' }} .
|