Skip to content

Commit

Permalink
Release v1.0.0
Browse files Browse the repository at this point in the history
Based on Prettier v2.2.1
  • Loading branch information
tats-u committed Mar 22, 2021
1 parent 1af846b commit 96cf836
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit 96cf836

Please sign in to comment.