This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
38 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 |
---|---|---|
@@ -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 }} |
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