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