Merge pull request #71 from politie/update-workflows #59
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: CD | |
on: | |
push: | |
branches: [main] | |
env: | |
NODE_VERSION: 18.x | |
jobs: | |
bump-version: | |
name: Bump package.json Version | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.event.head_commit.message, '[CI/CD]') }} | |
outputs: | |
tag-name: ${{ steps.lib-bump.outputs.newTag }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# This is a public_repo Github personal access token. | |
token: ${{ secrets.WORKFLOW_GITHUB_TOKEN }} | |
- name: Bump version | |
id: lib-bump | |
uses: phips28/[email protected] | |
with: | |
tag-prefix: 'v' | |
commit-message: '[CI/CD]: bump to {{version}}' | |
release: | |
name: Release | |
needs: bump-version | |
if: startsWith(needs.bump-version.outputs.tag-name, 'v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ needs.bump-version.outputs.tag-name }} | |
- name: Use node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install | |
run: npm ci | |
- name: Test E2E | |
run: xvfb-run -a npm run test | |
- name: Test Server and Lint | |
run: npm run test-server && npm run lint | |
- name: Release on Marketplace | |
# This is a Marketplace (Manage) Azure DevOps personal access token. Choose "All accessible organizations"! | |
run: npx @vscode/vsce publish -p ${{ secrets.MARKETPLACE_TOKEN }} --no-git-tag-version | |
- name: Release on Github | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: '*.vsix' | |
tag_name: ${{ needs.bump-version.outputs.tag-name }} |