vsix: can run in secure mode + better queue #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |