diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..75521ba --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: release + +on: + push: + branches: + - master + paths: + - CHANGELOG.md + +jobs: + run: + name: release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2.3.4 + + - name: Generate Package + run: | + yarn install + yarn run build + + - name: Get changelog content + id: changelog_reader + uses: mindsers/changelog-reader-action@v2.0.0 + with: + path: ./CHANGELOG.md + + - name: Create release + id: create_release + uses: actions/create-release@v1.1.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.changelog_reader.outputs.version }} + release_name: Release v${{ steps.changelog_reader.outputs.version }} + body: >- + ${{ steps.changelog_reader.outputs.changes }} + prerelease: + ${{ steps.changelog_reader.outputs.status == 'prereleased' }} + draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} + + - name: Upload release asset + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: + ./vscode-conventional-commits-${{ + steps.changelog_reader.outputs.version }}.vsix + asset_name: + vscode-conventional-commits-${{ + steps.changelog_reader.outputs.version }}.vsix + asset_content_type: application/octet-stream diff --git a/.gitignore b/.gitignore index e73524c..1fe7860 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules out yarn-error.log .DS_Store +*.vsix \ No newline at end of file diff --git a/package.json b/package.json index 167b82e..d42ef4b 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,8 @@ "compile": "tsc -p ./", "watch": "tsc -watch -p ./", "release": "standard-version && vsce publish && git push --follow-tags", + "version": "standard-version && git push --follow-tags", + "build": "vsce package", "postinstall": "husky install", "prepublishOnly": "pinst --disable", "postpublish": "pinst --enable"