Skip to content

Commit

Permalink
👷 Use semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaHuhn committed Dec 31, 2020
1 parent f0f766e commit 74c9e9a
Show file tree
Hide file tree
Showing 13 changed files with 6,023 additions and 140 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "daily"
35 changes: 35 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Merge PRs
on:
pull_request:
types:
- labeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: Automerge
uses: pascalgn/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GH_PAT }}"
MERGE_LABELS: "merge,!work in progress,!wip"
MERGE_REMOVE_LABELS: "merge"
MERGE_METHOD: "merge"
MERGE_COMMIT_MESSAGE: ":twisted_rightwards_arrows: Merge #{pullRequest.number} ({pullRequest.title})"
MERGE_FORKS: false
UPDATE_LABELS: "merge"
UPDATE_METHOD: "merge"
- name: Delete merged branch
uses: koj-co/delete-merged-action@master
with:
branches: "!master, !production, *"
env:
GITHUB_TOKEN: "${{ secrets.GH_PAT }}"
25 changes: 0 additions & 25 deletions .github/workflows/cdn.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Dependabot PR CI
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
auto-merge:
name: Merge minor/patch updates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.GH_PAT }}
56 changes: 56 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Deploy CI
on:
release:
types: [created]
workflow_dispatch:
jobs:
build:
name: Build files
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 14
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Build TypeScript
run: npm run build
- name: Commit build
uses: stefanzweifel/[email protected]
with:
commit_message: ":rocket: Deploy new version [skip ci]"
commit_user_name: BetaHuhn Bot
commit_user_email: [email protected]
commit_author: BetaHuhn Bot <[email protected]>
upload:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: BetaHuhn/do-spaces-action@master
with:
access_key: ${{ secrets.ACCESS_KEY}}
secret_key: ${{ secrets.SECRET_KEY }}
space_name: ${{ secrets.SPACE_NAME }}
space_region: ${{ secrets.SPACE_REGION }}
source: "dist/feedback-js.min.js"
out_dir: "dist/feedback-js"
versioning: true
8 changes: 5 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Lint
name: Lint CI
on:
push:
branches: [ master ]
branches-ignore:
- master
pull_request:
branches: [ master ]
branches-ignore:
- master
jobs:
lint:
runs-on: ubuntu-latest
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/publish.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/workflows/release-scheduler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Release Scheduler CI
on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
releaseScheduler:
runs-on: ubuntu-latest
steps:
- name: Run release-scheduler
uses: koj-co/release-scheduler@master
env:
GH_PAT: ${{ secrets.GH_PAT }}
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release CI
on:
push:
branches:
- master
jobs:
release:
name: Build and release
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 14
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Build TypeScript
run: npm run build
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: "BetaHuhn Bot"
GIT_AUTHOR_EMAIL: "[email protected]"
GIT_COMMITTER_NAME: "BetaHuhn Bot"
GIT_COMMITTER_EMAIL: "[email protected]"
10 changes: 6 additions & 4 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Build
name: Test CI
on:
push:
branches: [ master ]
branches-ignore:
- master
pull_request:
branches: [ master ]
branches-ignore:
- master
jobs:
build:
test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip-build]')"
steps:
Expand Down
Loading

0 comments on commit 74c9e9a

Please sign in to comment.