Skip to content

Release 1.1.0

Release 1.1.0 #56

Workflow file for this run

name: Continuous Deployment
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Set up publishing
run: npm install vsce --save-dev
- name: Publish
run: npm run deploy
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Read package.json
id: package-json
run: |
content=`cat ./package.json`
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
echo "::set-output name=packageJson::$content"
- name: Get Changelog
id: changelog
run: |
version=${{fromJson(steps.package-json.outputs.packageJson).version}}
escaped_version=$(printf '%s\n' "$version" | sed -e 's/[]\/$*.^[]/\\&/g')
changelog=`sed -n "/^## \[$escaped_version]/,/^## /p" CHANGELOG.md | sed '$ d' | sed '1,1d'`
changelog1="${changelog//'%'/'%25'}"
changelog1="${changelog1//$'\n'/'%0A'}"
changelog1="${changelog1//$'\r'/'%0D'}"
changelog2="${changelog//$'\n'/'\\n'}"
changelog2="${changelog2//$'\r'/'\\r'}"
changelog2="${changelog2//$'('/'\('}"
changelog2="${changelog2//$')'/'\)'}"
changelog2="${changelog2//$'`'/'\`'}"
changelog2="${changelog2//$'"'/'\"'}"
changelog2="${changelog2//"'"/"'\''"}"
echo "::set-output name=escaped::$changelog"
echo "::set-output name=unescaped::$changelog1"
echo "::set-output name=doubleescaped::$changelog2"
- name: Github Release
id: release
uses: softprops/action-gh-release@v1
with:
body: "${{steps.changelog.outputs.unescaped}}"
tag_name: "${{fromJson(steps.package-json.outputs.packageJson).version}}"
- name: Prepare Discord Message
id: discord-msg
run: |
awk '{
gsub("#VERSION#","${{fromJson(steps.package-json.outputs.packageJson).version}}",$0);
gsub("#DESCRIPTION#","${{steps.changelog.outputs.doubleescaped}}",$0);
gsub("#URL#","${{steps.release.outputs.url}}",$0);
print $0;
}' ./.github/workflows/deploy_discord_message.json > ./.github/workflows/deploy_discord_message2.json
- name: Send Discord Message
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
raw-data: "./.github/workflows/deploy_discord_message2.json"