44 push :
55 branches :
66 - master
7+ workflow_dispatch :
78
89jobs :
910 release :
2324 node-version : ${{ matrix.node }}
2425
2526 - 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
2728
2829 - name : Release on GitHub
2930 run : npx semantic-release -p \
@@ -34,11 +35,11 @@ jobs:
3435 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3536
3637 - 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
3839
3940 - name : Check version difference
4041 run : |
41- if [ ${{ env. VERSION_BEFORE }} = ${{ env. VERSION_AFTER }} ]; then
42+ if [ $VERSION_BEFORE = $VERSION_AFTER ]; then
4243 echo 0 > has-new-release
4344 else
4445 echo 1 > has-new-release
@@ -67,27 +68,27 @@ jobs:
6768 name : has-new-release
6869
6970 - 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
7172
7273 - uses : actions/checkout@v2
73- if : env. HAS_NEW_RELEASE == 1
74+ if : $ HAS_NEW_RELEASE == 1
7475
7576 - uses : actions/cache@v1
76- if : env. HAS_NEW_RELEASE == 1
77+ if : $ HAS_NEW_RELEASE == 1
7778 with :
7879 path : ~/.npm
7980 key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
8081 restore-keys : |
8182 ${{ runner.os }}-node-
8283
8384 - name : Set up Node
84- if : env. HAS_NEW_RELEASE == 1
85+ if : $ HAS_NEW_RELEASE == 1
8586 uses : actions/setup-node@v1
8687 with :
8788 node-version : ${{ matrix.node }}
8889
8990 - name : Prepare release
90- if : env. HAS_NEW_RELEASE == 1
91+ if : $ HAS_NEW_RELEASE == 1
9192 run : |
9293 npm ci
9394 npm run dist
@@ -96,50 +97,50 @@ jobs:
9697 tar -czvf pg-api-windows.tar.gz -C ./bin pg-api-win.exe
9798
9899 - 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
101102
102103 - name : Upload linux release asset
103- if : env. HAS_NEW_RELEASE == 1
104+ if : $ HAS_NEW_RELEASE == 1
104105 uses : actions/upload-release-asset@v1
105106 env :
106107 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
107108 with :
108- upload_url : ${{ env. UPLOAD_URL }}
109+ upload_url : $UPLOAD_URL
109110 asset_path : ./pg-api-linux.tar.gz
110111 asset_name : pg-api-linux.tar.gz
111112 asset_content_type : application/gzip
112113
113114 - name : Upload macos release asset
114- if : env. HAS_NEW_RELEASE == 1
115+ if : $ HAS_NEW_RELEASE == 1
115116 uses : actions/upload-release-asset@v1
116117 env :
117118 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118119 with :
119- upload_url : ${{ env. UPLOAD_URL }}
120+ upload_url : $UPLOAD_URL
120121 asset_path : ./pg-api-macos.tar.gz
121122 asset_name : pg-api-macos.tar.gz
122123 asset_content_type : application/gzip
123124
124125 - name : Upload windows release asset
125- if : env. HAS_NEW_RELEASE == 1
126+ if : $ HAS_NEW_RELEASE == 1
126127 uses : actions/upload-release-asset@v1
127128 env :
128129 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
129130 with :
130- upload_url : ${{ env. UPLOAD_URL }}
131+ upload_url : $UPLOAD_URL
131132 asset_path : ./pg-api-windows.tar.gz
132133 asset_name : pg-api-windows.tar.gz
133134 asset_content_type : application/gzip
134135
135136 - 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
137138
138139 - name : Upload image to Docker Hub
139- if : env. HAS_NEW_RELEASE == 1
140+ if : $ HAS_NEW_RELEASE == 1
140141 uses : docker/build-push-action@v1
141142 with :
142143 username : ${{ secrets.DOCKER_USERNAME }}
143144 password : ${{ secrets.DOCKER_PASSWORD }}
144145 repository : supabase/pg-api
145- tags : latest,${{ env. VERSION }}
146+ tags : latest,$VERSION
0 commit comments