Skip to content

Merge pull request #56 from eclipse-cdt-cloud/dependabot/npm_and_yarn… #134

Merge pull request #56 from eclipse-cdt-cloud/dependabot/npm_and_yarn…

Merge pull request #56 from eclipse-cdt-cloud/dependabot/npm_and_yarn… #134

Workflow file for this run

name: ci
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 18.x
- name: Setup npmrc
run: |
echo "@eclipse-cdt-cloud:registry=https://npm.pkg.github.com/" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{secrets.GITHUB_TOKEN}}" >> .npmrc
- name: Build
env:
GITHUB_TOKEN: ${{github.token}}
run: |
yarn install --ignore-scripts
yarn build
yarn package
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: vsix-package
path: ./*.vsix
retention-days: 1
release:
needs: build
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/download-artifact@v4
with:
path: artifacts
- uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
with:
files: artifacts/*/*.vsix
determine-version:
name: Determine Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-extension-version.outputs.version }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 18.x
- name: Determine extension version
id: get-extension-version
run: |
VERSION=$(npm pkg get version | sed 's/"//g')
echo "Current version: $VERSION"
echo version=$VERSION >> $GITHUB_OUTPUT
publish-api-types:
name: Publish Extension API
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs:
- determine-version
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 18.x
registry-url: 'https://npm.pkg.github.com'
always-auth: true
- name: Set package version to match extension
run: yarn --cwd api version --no-git-tag-version --new-version=$VERSION
env:
VERSION: ${{ needs.determine-version.outputs.version }}
- run: yarn publish
working-directory: api
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-open-vsx-registry:
needs:
- release
- publish-api-types
name: Open VSX
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/download-artifact@v4
with:
path: artifacts
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 18.x
- name: Publish
run: |
npx ovsx publish -i artifacts/*/*.vsix -p ${{secrets.OPEN_VSX_TOKEN}}
publish-vscode-marketplace:
needs:
- release
- publish-api-types
name: VS Code Marketplace
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/download-artifact@v4
with:
path: artifacts
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 18.x
- name: Publish
run: |
npx vsce publish -i artifacts/*/*.vsix -p ${{secrets.VS_MARKETPLACE_TOKEN}}