-
Notifications
You must be signed in to change notification settings - Fork 27
75 lines (58 loc) · 2.09 KB
/
on_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
68
69
70
71
72
73
74
75
name: release new version
on:
workflow_dispatch:
release:
types: [published]
jobs:
release-binaries:
runs-on: ubuntu-22.04
steps:
- name: checkout the source code
uses: actions/checkout@v3
- uses: wistia/parse-tool-versions@v1.0
- uses: earthly/actions-setup@v1
with: { version: "v${{ env.EARTHLY_TOOL_VERSION }}" }
- name: Extract tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Extract short sha
run: echo "SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
- name: login to registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the binaries
run: |
./earthly \
--push \
+release-binaries \
--version=${{ env.RELEASE_VERSION }} \
--commitSHA=${{ env.SHORT_SHA }} \
--token ${{ secrets.GITHUB_TOKEN }}
release-image:
runs-on: ubuntu-22.04
steps:
- name: checkout the source code
uses: actions/checkout@v3
- uses: wistia/parse-tool-versions@v1.0
- uses: earthly/actions-setup@v1
with: { version: "v${{ env.EARTHLY_TOOL_VERSION }}" }
- name: Extract tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Extract short sha
run: echo "SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
- name: login to registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the Docker image
run: |
./earthly \
--push \
+build-image-multiarch \
--version=${{ env.RELEASE_VERSION }} \
--commitSHA=${{ env.SHORT_SHA }} \
--image_name=ghcr.io/${{ github.repository_owner }}/prom-aggregation-gateway