-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (62 loc) · 2.01 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: release
on:
push:
tags:
- 'v[0-9]+.[0-9]+*'
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.21
- name: Install Go tools
run: go install github.com/deepmap/oapi-codegen/cmd/[email protected]
# Prepare the GitHub release.
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
install-only: true
distribution: goreleaser
version: 1.2.5
- name: Build and publish the next release
run: |
make release-build
env:
# Instruct Make to create a real release.
NEXUS_REAL_RELEASE: "true"
# Pass automatically created GitHub App installation token to the action.
# For more info, see:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Prepare the tagged Docker image.
- name: Set release tag
run: |
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push docker
uses: docker/build-push-action@v3
with:
build-args: |
TAG=${{ env.TAG }}
context: .
file: docker/nexus/Dockerfile
tags: |
oasislabs/oasis-indexer:${{ env.TAG }}
push: true
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}