-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Based on Prettier v2.2.1
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: CI (Release) | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
test-again: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
steps: | ||
- name: Set git to use LF | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
if: runner.os == 'Windows' | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Build package | ||
run: yarn build | ||
- name: Run tests | ||
run: yarn test | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test-again | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js And Setup .npmrc | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "14" | ||
registry-url: "https://registry.npmjs.org" | ||
- name: Create a Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag | ||
tag_name: ${{ github.ref }} | ||
# The name of the release. For example, `Release v1.0.1` | ||
release_name: Release ${{ github.ref }} | ||
- name: Get the version | ||
id: get_version | ||
run: | | ||
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | ||
echo ::set-output name=DEB_NAME::$(basename $(ls ${{ runner.temp }}/deb-package/*.deb | tail -n 1)) | ||
- 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- | ||
- name: Publish module | ||
run: yarn publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
id: publish |