From dc87cb8a36af4e5ccd082280f466e50ac2c27173 Mon Sep 17 00:00:00 2001 From: Deimonn Date: Fri, 26 Apr 2024 12:20:53 -0300 Subject: [PATCH] Push CI configuration --- .github/workflows/build.yaml | 27 +++++++++++++++++++++ .github/workflows/publish.yaml | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..c7b4746 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,27 @@ +name: Lint and build extension + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 21.x + + - name: Install extension dependencies + run: npm ci + + - name: Run ESLint previous to building + run: npx eslint src --ext ts --max-warnings 0 + + - name: Build and package the extension + run: npx -p @vscode/vsce -c 'vsce package' diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..38073bc --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,43 @@ +name: Publish and release extension + +on: + push: + tags: + - v** + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 21.x + + - name: Install extension dependencies + run: npm ci + + - name: Package extension + run: npx -p @vscode/vsce --yes -c 'vsce package' + + - name: Publish on Visual Studio Marketplace + run: npx -p @vscode/vsce --yes -c 'vsce publish -i *.vsix' + env: + VSCE_PAT: ${{ secrets.VSCE_PAT }} + + - name: Publish on Eclipse Open VSX + run: npx -p ovsx --yes -c 'ovsx publish *.vsix' + env: + OVSX_PAT: ${{ secrets.OVSX_PAT }} + + - name: Create release on GitHub + uses: softprops/action-gh-release@v1 + with: + files: '*.vsix' + body: See [CHANGELOG.md](https://github.com/deimonn/oro-theme/blob/master/CHANGELOG.md) for a list of additions, changes and fixes. + prerelease: ${{ endsWith(github.ref, '-preview') }} + env: + GITHUB_TOKEN: ${{ github.token }}