Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Update release workflow (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzkaczor authored Dec 25, 2020
1 parent 0723cb1 commit a787783
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 38 deletions.
50 changes: 15 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,41 @@
name: release
name: Release

on:
push:
workflow_run:
workflows:
- CI
branches:
- master
paths:
- './src/**/*'
- 'package.json'
- 'action.yml'
types:
- completed

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- uses: actions/setup-node@v1
with:
node-version: '12.x'

node-version: 12.x
- name: Cache YARN dependencies
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.OS }}-12.x-yarn-cache-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.OS }}-${{ matrix.node }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.OS }}-${{ matrix.node }}-yarn-cache-

- run: yarn --no-progress --non-interactive --frozen-lockfile
# note this is exactly the same as on CI workflow
- run: yarn lint
- run: yarn format
- run: yarn build
- run: yarn test
- run: yarn typecheck

- run: yarn build

- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --force dist/index.js
git add action.yml README.md
git stash
git fetch --all
git checkout action
git checkout stash -- .
git commit -m "Automated release" -a
- name: Push changes
uses: ad-m/github-push-action@master
- uses: ActionwareIO/branch-push-action@action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: action
files: |
README.md
action.yml
./dist/index.js
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"lib": ["ES2015"],
"module": "CommonJS",
"lib": ["ES2019"],
"module": "commonjs",
"target": "ES2019",
"moduleResolution": "node",
"strict": true,
"target": "ES2015",
"esModuleInterop": true,
"outDir": "dist"
}
Expand Down

0 comments on commit a787783

Please sign in to comment.