Skip to content

Commit

Permalink
Merge branch 'develop' into nasdf/fix/peer-connections
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdf authored Aug 26, 2024
2 parents 48c998a + 495c456 commit 1654c0e
Show file tree
Hide file tree
Showing 47 changed files with 3,163 additions and 1,978 deletions.
76 changes: 46 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,11 @@ jobs:
cache: false

- name: Apply tag
run: git tag ${{ github.event.inputs.tag }}
run: git tag v${{ github.event.inputs.tag }}

- name: Build modules
run: make deps:modules

- name: Set up QEMU
if: matrix.os == 'ubuntu-latest'
uses: docker/setup-qemu-action@v3

- name: Log in to Docker Hub
if: matrix.os == 'ubuntu-latest'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
if: matrix.os == 'ubuntu-latest'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run command to get SHA environment
shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> ${GITHUB_ENV}
Expand Down Expand Up @@ -114,7 +95,7 @@ jobs:
fetch-depth: 0

- name: Apply tag
run: git tag ${{ github.event.inputs.tag }}
run: git tag v${{ github.event.inputs.tag }}

- name: Setup Go environment explicitly
uses: actions/setup-go@v5
Expand All @@ -123,12 +104,6 @@ jobs:
check-latest: true
cache: false

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Run command to get SHA environment
shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> ${GITHUB_ENV}
Expand Down Expand Up @@ -179,17 +154,58 @@ jobs:
GITHUB_REPOSITORY: ${{ github.repository }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

docker-build-push:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout code into the directory
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: tools/defradb.containerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ github.repository_owner }}/defradb:latest
${{ github.repository_owner }}/defradb:${{ github.event.inputs.tag }}
ghcr.io/${{ github.repository_owner }}/defradb:latest
ghcr.io/${{ github.repository_owner }}/defradb:${{ github.event.inputs.tag }}
pull-docker-image:
name: Pull docker image job
runs-on: ubuntu-latest
needs: prepare
needs: docker-build-push

strategy:
fail-fast: false
matrix:
image_tag:
- sourcenetwork/defradb:latest
- ghcr.io/sourcenetwork/defradb:latest
- ${{ github.repository_owner }}/defradb:latest
- ghcr.io/${{ github.repository_owner }}/defradb:latest

steps:
- name: Log in to Docker Hub
Expand Down
20 changes: 0 additions & 20 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,3 @@ milestones:
- close: true
fail_on_error: false
name_template: "DefraDB v{{ .Major }}.{{ .Minor }}"

dockers:
- ids:
- "defradb_playground"
image_templates:
- "{{ .Env.GITHUB_REPOSITORY }}:latest"
- "{{ .Env.GITHUB_REPOSITORY }}:{{ .Version }}"
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY }}:latest"
- "ghcr.io/{{ .Env.GITHUB_REPOSITORY }}:{{ .Version }}"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.description=DefraDB is a Peer-to-Peer Edge Database."
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.name={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
- "--label=org.opencontainers.image.source={{ .GitURL }}"
- "--platform=linux/amd64"
dockerfile: ./tools/goreleaser.containerfile
Loading

0 comments on commit 1654c0e

Please sign in to comment.