forked from zapier/prom-aggregation-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (66 loc) · 2.37 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
76
77
78
79
80
81
82
83
84
85
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/[email protected]
- 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/[email protected]
- 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: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set lower case owner name
id: lower-case
run: |
echo "repository_owner=${OWNER,,}" >> ${GITHUB_OUTPUT}
env:
OWNER: ${{ github.repository_owner }}
- 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/${{ steps.lower-case.outputs.repository_owner }}/prom-aggregation-gateway