Merge pull request #6 from upsetjs/release/v2.3.1 #2
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
name: Release Helper | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
correct_repository: | |
runs-on: ubuntu-latest | |
steps: | |
- name: fail on fork | |
if: github.repository_owner != 'upsetjs' | |
run: exit 1 | |
create_release: | |
needs: correct_repository | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Extract version | |
id: extract_version | |
run: node -pe "'::set-output name=version::' + require('./package.json').version" | |
- name: Create Release | |
id: create_release | |
uses: release-drafter/release-drafter@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
version: ${{ steps.extract_version.outputs.version }} | |
publish: true | |
outputs: | |
version: ${{ steps.extract_version.outputs.version }} | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
tag_name: ${{ steps.create_release.outputs.tag_name }} | |
build_assets: | |
needs: create_release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
- run: npm i -g yarn | |
- run: yarn config set checksumBehavior ignore | |
- name: Cache Node.js modules | |
uses: actions/cache@v2 | |
with: | |
path: | | |
./.yarn/cache | |
./.yarn/unplugged | |
key: ${{ runner.os }}-yarn2-v4-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn2-v4 | |
- run: yarn install | |
- run: yarn build | |
- run: yarn pack | |
- name: Upload Release Asset | |
uses: AButler/[email protected] | |
with: | |
files: 'package.tgz' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
release-tag: ${{ needs.create_release.outputs.tag_name }} | |
- name: Publish to NPM | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
access: public | |
check-version: true | |
sync_dev: | |
needs: correct_repository | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
ref: dev | |
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }} | |
- name: Reset dev branch | |
run: | | |
git fetch origin main:main | |
git merge main | |
git push |