vsc-material-theme/.github/workflows/release.yml

78 lines
2.2 KiB
YAML
Raw Normal View History

2020-09-05 08:49:50 +02:00
name: Release Extension
on:
push:
2020-09-05 09:43:55 +02:00
branches:
- master
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:43:55 +02:00
prepare:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
name: Cache node_modules
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-
- name: Install Dependencies
run: yarn --frozen-lockfile
if: steps.cache-yarn-cache.outputs.cache-hit != 'true' || steps.cache-node-modules.outputs.cache-hit != 'true'
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 09:43:55 +02:00
needs: prepare
2020-09-05 08:49:50 +02:00
steps:
- uses: actions/checkout@v2
2020-09-05 09:43:55 +02:00
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn --frozen-lockfile
if: steps.cache-yarn-cache.outputs.cache-hit != 'true' || steps.cache-node-modules.outputs.cache-hit != 'true'
2020-09-05 09:45:47 +02:00
- name: Build extension
run: yarn build
2020-09-05 08:49:50 +02:00
- uses: lannonbr/vsce-action@master
with:
args: "publish -p $VSCE_TOKEN"
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}