4
4
push :
5
5
branches :
6
6
- master
7
+ workflow_dispatch :
7
8
8
9
jobs :
9
10
release :
23
24
node-version : ${{ matrix.node }}
24
25
25
26
- name : Get version before
26
- run : echo ::set-env name= VERSION_BEFORE:: $(curl -s https://api.github.com/repos/supabase/pg-api/releases/latest | jq .name -r)
27
+ run : echo " VERSION_BEFORE= $(curl -s https://api.github.com/repos/supabase/pg-api/releases/latest | jq .name -r)" >> $GITHUB_ENV
27
28
28
29
- name : Release on GitHub
29
30
run : npx semantic-release -p \
@@ -34,11 +35,11 @@ jobs:
34
35
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35
36
36
37
- name : Get version after
37
- run : echo ::set-env name= VERSION_AFTER:: $(curl -s https://api.github.com/repos/supabase/pg-api/releases/latest | jq .name -r)
38
+ run : echo " VERSION_AFTER= $(curl -s https://api.github.com/repos/supabase/pg-api/releases/latest | jq .name -r)" >> $GITHUB_ENV
38
39
39
40
- name : Check version difference
40
41
run : |
41
- if [ ${{ env. VERSION_BEFORE }} = ${{ env. VERSION_AFTER }} ]; then
42
+ if [ $VERSION_BEFORE = $VERSION_AFTER ]; then
42
43
echo 0 > has-new-release
43
44
else
44
45
echo 1 > has-new-release
@@ -67,27 +68,27 @@ jobs:
67
68
name : has-new-release
68
69
69
70
- name : Check for new release
70
- run : echo ::set-env name= HAS_NEW_RELEASE:: $(cat has-new-release/has-new-release)
71
+ run : echo " HAS_NEW_RELEASE= $(cat has-new-release/has-new-release)" >> $GITHUB_ENV
71
72
72
73
- uses : actions/checkout@v2
73
- if : env. HAS_NEW_RELEASE == 1
74
+ if : $ HAS_NEW_RELEASE == 1
74
75
75
76
- uses : actions/cache@v1
76
- if : env. HAS_NEW_RELEASE == 1
77
+ if : $ HAS_NEW_RELEASE == 1
77
78
with :
78
79
path : ~/.npm
79
80
key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
80
81
restore-keys : |
81
82
${{ runner.os }}-node-
82
83
83
84
- name : Set up Node
84
- if : env. HAS_NEW_RELEASE == 1
85
+ if : $ HAS_NEW_RELEASE == 1
85
86
uses : actions/setup-node@v1
86
87
with :
87
88
node-version : ${{ matrix.node }}
88
89
89
90
- name : Prepare release
90
- if : env. HAS_NEW_RELEASE == 1
91
+ if : $ HAS_NEW_RELEASE == 1
91
92
run : |
92
93
npm ci
93
94
npm run dist
@@ -96,50 +97,50 @@ jobs:
96
97
tar -czvf pg-api-windows.tar.gz -C ./bin pg-api-win.exe
97
98
98
99
- name : Get upload url
99
- if : env. HAS_NEW_RELEASE == 1
100
- run : echo ::set-env name= UPLOAD_URL:: $(curl -s https://api.github.com/repos/supabase/pg-api/releases/latest | jq .upload_url -r)
100
+ if : $ HAS_NEW_RELEASE == 1
101
+ run : echo " UPLOAD_URL= $(curl -s https://api.github.com/repos/supabase/pg-api/releases/latest | jq .upload_url -r)" >> $GITHUB_ENV
101
102
102
103
- name : Upload linux release asset
103
- if : env. HAS_NEW_RELEASE == 1
104
+ if : $ HAS_NEW_RELEASE == 1
104
105
uses : actions/upload-release-asset@v1
105
106
env :
106
107
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
107
108
with :
108
- upload_url : ${{ env. UPLOAD_URL }}
109
+ upload_url : $UPLOAD_URL
109
110
asset_path : ./pg-api-linux.tar.gz
110
111
asset_name : pg-api-linux.tar.gz
111
112
asset_content_type : application/gzip
112
113
113
114
- name : Upload macos release asset
114
- if : env. HAS_NEW_RELEASE == 1
115
+ if : $ HAS_NEW_RELEASE == 1
115
116
uses : actions/upload-release-asset@v1
116
117
env :
117
118
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118
119
with :
119
- upload_url : ${{ env. UPLOAD_URL }}
120
+ upload_url : $UPLOAD_URL
120
121
asset_path : ./pg-api-macos.tar.gz
121
122
asset_name : pg-api-macos.tar.gz
122
123
asset_content_type : application/gzip
123
124
124
125
- name : Upload windows release asset
125
- if : env. HAS_NEW_RELEASE == 1
126
+ if : $ HAS_NEW_RELEASE == 1
126
127
uses : actions/upload-release-asset@v1
127
128
env :
128
129
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
129
130
with :
130
- upload_url : ${{ env. UPLOAD_URL }}
131
+ upload_url : $UPLOAD_URL
131
132
asset_path : ./pg-api-windows.tar.gz
132
133
asset_name : pg-api-windows.tar.gz
133
134
asset_content_type : application/gzip
134
135
135
136
- name : Get version
136
- run : echo ::set-env name= VERSION:: $(curl -s https://api.github.com/repos/supabase/pg-api/releases/latest | jq .name -r)
137
+ run : echo " VERSION= $(curl -s https://api.github.com/repos/supabase/pg-api/releases/latest | jq .name -r)" >> $GITHUB_ENV
137
138
138
139
- name : Upload image to Docker Hub
139
- if : env. HAS_NEW_RELEASE == 1
140
+ if : $ HAS_NEW_RELEASE == 1
140
141
uses : docker/build-push-action@v1
141
142
with :
142
143
username : ${{ secrets.DOCKER_USERNAME }}
143
144
password : ${{ secrets.DOCKER_PASSWORD }}
144
145
repository : supabase/pg-api
145
- tags : latest,${{ env. VERSION }}
146
+ tags : latest,$VERSION
0 commit comments