|
|
@@ -647,6 +647,19 @@ jobs:
|
|
|
runs-on: ubuntu-latest
|
|
|
if: github.event_name == 'push' && (github.ref == 'refs/heads/release' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-'))
|
|
|
environment: docker
|
|
|
+ strategy:
|
|
|
+ matrix:
|
|
|
+ pkg:
|
|
|
+ - syncthing
|
|
|
+ - strelaysrv
|
|
|
+ - stdiscosrv
|
|
|
+ include:
|
|
|
+ - pkg: syncthing
|
|
|
+ dockerfile: Dockerfile
|
|
|
+ - pkg: strelaysrv
|
|
|
+ dockerfile: Dockerfile.strelaysrv
|
|
|
+ - pkg: stdiscosrv
|
|
|
+ dockerfile: Dockerfile.stdiscosrv
|
|
|
steps:
|
|
|
- uses: actions/checkout@v3
|
|
|
with:
|
|
|
@@ -663,13 +676,13 @@ jobs:
|
|
|
path: |
|
|
|
~/.cache/go-build
|
|
|
~/go/pkg/mod
|
|
|
- key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-docker-${{ hashFiles('**/go.sum') }}
|
|
|
+ key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-docker-${{ matrix.pkg }}-${{ hashFiles('**/go.sum') }}
|
|
|
|
|
|
- name: Build binaries
|
|
|
run: |
|
|
|
for arch in arm64 amd64; do
|
|
|
- go run build.go -goos linux -goarch "$arch" -no-upgrade build syncthing
|
|
|
- mv syncthing syncthing-linux-"$arch"
|
|
|
+ go run build.go -goos linux -goarch "$arch" -no-upgrade build ${{ matrix.pkg }}
|
|
|
+ mv ${{ matrix.pkg }} ${{ matrix.pkg }}-linux-"$arch"
|
|
|
done
|
|
|
env:
|
|
|
CGO_ENABLED: "0"
|
|
|
@@ -692,21 +705,21 @@ jobs:
|
|
|
echo Release version, pushing to :latest and version tags
|
|
|
major=${version%.*.*}
|
|
|
minor=${version%.*}
|
|
|
- tags=syncthing/syncthing:$version,syncthing/syncthing:$major,syncthing/syncthing:$minor,syncthing/syncthing:latest
|
|
|
+ tags=syncthing/${{ matrix.pkg }}:$version,syncthing/${{ matrix.pkg }}:$major,syncthing/${{ matrix.pkg }}:$minor,syncthing/${{ matrix.pkg }}:latest
|
|
|
elif [[ $version == *-rc.@([0-9]|[0-9][0-9]) ]] ; then
|
|
|
echo Release candidate, pushing to :rc
|
|
|
- tags=syncthing/syncthing:rc
|
|
|
+ tags=syncthing/${{ matrix.pkg }}:rc
|
|
|
else
|
|
|
echo Development version, pushing to :edge
|
|
|
- tags=syncthing/syncthing:edge
|
|
|
+ tags=syncthing/${{ matrix.pkg }}:edge
|
|
|
fi
|
|
|
echo "DOCKER_TAGS=$tags" >> $GITHUB_ENV
|
|
|
|
|
|
- - name: Build and push syncthing
|
|
|
+ - name: Build and push Docker image
|
|
|
uses: docker/build-push-action@v4
|
|
|
with:
|
|
|
context: .
|
|
|
- file: ./Dockerfile
|
|
|
+ file: ${{ matrix.dockerfile }}
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
push: true
|
|
|
tags: ${{ env.DOCKER_TAGS }}
|