2020-09-05 08:49:50 +02:00
|
|
|
name: Release Extension
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-09-05 09:43:55 +02:00
|
|
|
branches:
|
2022-12-01 17:08:13 +01:00
|
|
|
- main
|
2020-09-05 08:49:50 +02:00
|
|
|
tags:
|
2020-09-05 09:32:32 +02:00
|
|
|
- v*
|
2020-09-05 09:43:55 +02:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '*'
|
2020-09-05 08:49:50 +02:00
|
|
|
|
|
|
|
jobs:
|
2020-09-05 09:32:32 +02:00
|
|
|
release:
|
2020-09-05 08:49:50 +02:00
|
|
|
runs-on: ubuntu-latest
|
2020-09-05 09:32:32 +02:00
|
|
|
if: contains(github.ref, 'tag')
|
2020-09-05 08:49:50 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-09-05 09:43:55 +02:00
|
|
|
|
2020-09-05 09:49:07 +02:00
|
|
|
- name: Use Node Version 12
|
2024-06-12 10:08:45 +02:00
|
|
|
uses: actions/setup-node@v4
|
2020-09-05 09:49:07 +02:00
|
|
|
with:
|
2024-06-12 10:08:45 +02:00
|
|
|
node-version: '20.x'
|
2020-09-05 09:49:07 +02:00
|
|
|
|
2022-12-01 18:20:24 +01:00
|
|
|
- name: Get npm cache directory
|
|
|
|
id: npm-cache-dir
|
2023-11-30 15:56:39 +01:00
|
|
|
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
|
2020-09-05 09:43:55 +02:00
|
|
|
|
2024-06-12 10:08:45 +02:00
|
|
|
- uses: actions/cache@v4
|
2022-12-01 18:20:24 +01:00
|
|
|
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
|
2020-09-05 09:43:55 +02:00
|
|
|
with:
|
2022-12-01 18:20:24 +01:00
|
|
|
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
2020-09-05 09:43:55 +02:00
|
|
|
restore-keys: |
|
2022-12-01 18:20:24 +01:00
|
|
|
${{ runner.os }}-node-
|
2020-09-05 09:43:55 +02:00
|
|
|
|
|
|
|
- name: Install Dependencies
|
2022-12-01 18:20:24 +01:00
|
|
|
run: npm ci
|
|
|
|
if: steps.cache-npm-cache.outputs.cache-hit != 'true' || steps.cache-node-modules.outputs.cache-hit != 'true'
|
2020-09-05 09:43:55 +02:00
|
|
|
|
2020-09-05 09:45:47 +02:00
|
|
|
- name: Build extension
|
2022-12-01 18:20:24 +01:00
|
|
|
run: npm run build
|
2020-09-05 09:45:47 +02:00
|
|
|
|
2024-06-12 10:08:45 +02:00
|
|
|
- uses: lannonbr/vsce-action@3.0.0
|
2020-09-05 08:49:50 +02:00
|
|
|
with:
|
|
|
|
args: "publish -p $VSCE_TOKEN"
|
|
|
|
env:
|
|
|
|
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
|