-
-
Notifications
You must be signed in to change notification settings - Fork 127
120 lines (104 loc) · 3.54 KB
/
release.yml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Release
on:
push:
branches:
- master
workflow_dispatch:
jobs:
semantic-release:
name: Release
runs-on: ubuntu-20.04
outputs:
new-release-published: ${{ steps.semantic-release.outputs.new_release_published }}
new-release-version: ${{ steps.semantic-release.outputs.new_release_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: |
npm clean-install
npm run build
- id: semantic-release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 18
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
upload:
name: Upload assets to GitHub Releases
needs:
- semantic-release
if: needs.semantic-release.outputs.new-release-published == 'true'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Prepare release
run: |
npm clean-install
npm run pkg
mv bin/postgres-meta-linux postgres-meta
tar -czvf postgres-meta-${{ needs.semantic-release.outputs.new-release-version }}-x86_64-linux-gnu.tar.gz postgres-meta
mv bin/postgres-meta-macos postgres-meta
tar -czvf postgres-meta-${{ needs.semantic-release.outputs.new-release-version }}-x86_64-apple-darwin.tar.gz postgres-meta
mv bin/postgres-meta-win.exe postgres-meta.exe
tar -czvf postgres-meta-${{ needs.semantic-release.outputs.new-release-version }}-x86_64-pc-windows.tar.gz postgres-meta.exe
- uses: softprops/action-gh-release@v1
with:
tag_name: v${{ needs.semantic-release.outputs.new-release-version }}
files: postgres-meta-*.tar.gz
docker-hub:
name: Release on Docker Hub
needs:
- semantic-release
if: needs.semantic-release.outputs.new-release-published == 'true'
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for requesting the JWT from AWS
contents: read
packages: write
steps:
- id: meta
uses: docker/metadata-action@v5
with:
images: |
supabase/postgres-meta
public.ecr.aws/supabase/postgres-meta
ghcr.io/supabase/postgres-meta
tags: |
type=raw,value=v${{ needs.semantic-release.outputs.new-release-version }}
- uses: docker/setup-qemu-action@v2
with:
platforms: amd64,arm64
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
aws-region: us-east-1
- name: Login to ECR
uses: docker/login-action@v3
with:
registry: public.ecr.aws
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max