-
Notifications
You must be signed in to change notification settings - Fork 11
35 lines (33 loc) · 1.26 KB
/
ci.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
name: ci
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: check key extract
run: |
[ "$(DZR_CBC= ./dzr ! 2>/dev/null | sha1sum)" = '3ad58d9232a3745ad9308b0669c83b6f7e8dba4d -' ]
- name: bundle VSIX
run: zip -r $(jq -r '.name+"-"+.version+".vsix"' < extension/package.json) extension
- name: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_FILES: dzr*
run: |
RELEASE_TAG="$(date +%y%m%d)"
curl -s -XPOST -d '{"tag_name": "'$RELEASE_TAG'"}' \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H 'Content-Type: application/json' \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases" || :
RELEASE_ID=$(curl -s https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/$RELEASE_TAG | jq .id)
echo tag=$RELEASE_TAG has id=$RELEASE_ID
for RELEASE_FILE in $RELEASE_FILES; do
curl -s -XPOST -T $RELEASE_FILE \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type:application/octet-stream" \
"https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/$RELEASE_ID/assets?name=$RELEASE_FILE" || :
done