Merge branch 'master' of github.com:logotip4ik/keycap #47
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 | |
permissions: | |
contents: write | |
on: | |
workflow_run: | |
workflows: [Auto update dependencies] | |
types: [completed] | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
test-lint-build: | |
if: ${{ github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' }} | |
timeout-minutes: 3 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkouting repo | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Node setup | |
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 | |
with: | |
node-version: 18 | |
cache: yarn | |
- name: Install deps | |
run: yarn install | |
- name: Run tests | |
run: yarn run test | |
- name: Run lint:fix | |
run: yarn run lint:fix --ignore-pattern ".github" | |
- name: Run Build | |
run: yarn run build | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "${{ github.actor }}" | |
git commit -a -m "chore: apply fixes" || echo "nothing to update" | |
git pull | |
- name: Push changes | |
uses: ad-m/github-push-action@9a2e3c14aaecf56d5816dc3a54514f82050820b2 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
bump-package-version: | |
needs: test-lint-build | |
timeout-minutes: 4 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkouting repo | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Node setup | |
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 | |
with: | |
node-version: 18 | |
cache: yarn | |
- name: Bump versions | |
run: | | |
git config --local user.email [email protected] | |
git config --local user.name ${{ github.actor }} | |
git pull | |
npx changelogen@latest --release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push changes | |
uses: ad-m/github-push-action@9a2e3c14aaecf56d5816dc3a54514f82050820b2 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
trigger-release: | |
needs: [test-lint-build, bump-package-version] | |
timeout-minutes: 1 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trigger deployment | |
env: | |
TRIGGER_DEPLOYMENT: ${{ secrets.TRIGGER_DEPLOYMENT }} | |
shell: bash | |
run: curl -X POST $TRIGGER_DEPLOYMENT |