mirror of https://github.com/fmartingr/bazaar.git
parent
99845f1ad6
commit
9e223b5650
|
@ -10,6 +10,8 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
@ -7,6 +7,9 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
buildx:
|
buildx:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read # Required to read dist files (and repository)
|
||||||
|
packages: write # Required to push packages to GHCR
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
name: Build Docker
|
name: Build Docker
|
||||||
|
@ -20,15 +23,18 @@ jobs:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
|
- name: Log in to registry
|
||||||
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
|
||||||
|
|
||||||
- name: Buildx
|
- name: Buildx
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login -u "${{ github.repository_owner }}" --password-stdin ghcr.io
|
|
||||||
REPOSITORY=ghcr.io/${{ github.repository }}
|
REPOSITORY=ghcr.io/${{ github.repository }}
|
||||||
|
|
||||||
TAG=latest
|
TAG_COMMIT=$(git describe --tag)
|
||||||
|
TAG_MAIN=latest
|
||||||
if [ -z "$(git tag --points-at HEAD)" ]
|
if [ -z "$(git tag --points-at HEAD)" ]
|
||||||
then
|
then
|
||||||
TAG="dev"
|
TAG_MAIN="dev"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CONTAINER_BUILDX_OPTIONS="--push --output=type=registry --tag $REPOSITORY:$(git describe --tags) --tag $REPOSITORY:$TAG" make buildx
|
CONTAINER_BUILDX_OPTIONS="--push --output=type=registry --tag $REPOSITORY:$TAG_COMMIT --tag $REPOSITORY:$TAG_MAIN" make buildx
|
||||||
|
|
|
@ -2,11 +2,11 @@ name: "golangci-lint"
|
||||||
|
|
||||||
on: workflow_call
|
on: workflow_call
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: read
|
|
||||||
jobs:
|
jobs:
|
||||||
golangci:
|
golangci:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
|
@ -3,12 +3,11 @@ name: goreleaser
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write # Required to upload dist files
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
goreleaser:
|
goreleaser:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write # Required to upload dist files
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
|
@ -10,6 +10,8 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
@ -5,9 +5,6 @@ on:
|
||||||
branches: [latest]
|
branches: [latest]
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write # Required to upload dist files
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ci-push-version-${{ github.ref }}
|
group: ci-push-version-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
|
@ -6,7 +6,8 @@ ARG TARGETARCH
|
||||||
ARG TARGETOS
|
ARG TARGETOS
|
||||||
ARG TARGETVARIANT
|
ARG TARGETVARIANT
|
||||||
COPY dist/bazaar_${TARGETOS}_${TARGETARCH}${TARGETVARIANT}/bazaar /usr/bin/bazaar
|
COPY dist/bazaar_${TARGETOS}_${TARGETARCH}${TARGETVARIANT}/bazaar /usr/bin/bazaar
|
||||||
RUN apk add --no-cache ca-certificates tzdata make
|
RUN apk add --no-cache ca-certificates tzdata && \
|
||||||
|
chmod +x /usr/bin/bazaar
|
||||||
|
|
||||||
# Server image
|
# Server image
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
@ -19,5 +20,4 @@ COPY --from=builder /usr/bin/bazaar /usr/bin/bazaar
|
||||||
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
|
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/bazaar"]
|
ENTRYPOINT ["/usr/bin/bazaar"]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -ex
|
||||||
|
|
||||||
if [ -z "$FROM_MAKEFILE" ]; then
|
if [ -z "$FROM_MAKEFILE" ]; then
|
||||||
echo "Do not call this file directly - use the make command"
|
echo "Do not call this file directly - use the make command"
|
||||||
|
|
Loading…
Reference in New Issue