Skip to content

Commit

Permalink
update release process (#212)
Browse files Browse the repository at this point in the history
Co-authored-by: Nathan Rogan <nathan.rogan@wmca.org.uk>
  • Loading branch information
rolorogan and nathan-rogan authored Jul 8, 2021
1 parent 0250f5a commit ef9151b
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 80 deletions.
7 changes: 4 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: monthly
open-pull-requests-limit: 10
interval: daily
open-pull-requests-limit: 0
target-branch: 'release'
commit-message:
prefix: '[skip netlify]'
prefix: '[skip netlify]'
22 changes: 22 additions & 0 deletions .github/workflows/branch-guard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# if the base_ref(target branch we want to merge to) is master and the head_ref(source branch we want to merge from)
# Then throw an error, as only release is allowed to merge into master
# Otherwise this action won't run and show as success
name: 'Branch guard 🛡️'

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
can-merge-to-branch:
name: Can merge to branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checking if branch is allowed...
if: "github.base_ref == 'master' && github.head_ref != 'release'"
run: |
echo "";
echo "::error::Not allowed to merge '$GITHUB_HEAD_REF' branch into '$GITHUB_BASE_REF' branch";
echo "---";
exit 1;
2 changes: 1 addition & 1 deletion .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
lint:
name: Lint PR
name: Linting PR title
runs-on: ubuntu-latest
if: "startsWith(github.base_ref, 'release')"
steps:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/release-notes-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ame: Release-Notes-Preview

on:
pull_request:
branches: [master]
issue_comment:
types: [edited]

jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow --tags
- uses: snyk/release-notes-preview@v1.6.1
with:
releaseBranch: master
env:
GITHUB_PR_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 12 additions & 4 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release npm package
name: Release package

on:
push:
Expand All @@ -18,9 +18,9 @@ jobs:
persist-credentials: false
# Setup node environment
- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: '14.x'
# Dry run a release to check if one if necessary
- name: Check for new release
uses: cycjimmy/semantic-release-action@v2.5.0
Expand All @@ -33,6 +33,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.SEMVER_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Get modules from cache
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# Build site
- name: Build site
run: |
Expand Down Expand Up @@ -65,4 +73,4 @@ jobs:
# functions-dir: ./functions
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
4 changes: 2 additions & 2 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ restylers:
- clang-format:
enabled: false

- prettier:
enabled: true
- name: prettier
arguments: ['--config=./.prettierrc', '--ignore-path=./.prettierignore']
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# 1. WMCA Design System

![Netlify](https://img.shields.io/netlify/04471bb6-9621-4c59-abe8-b4fdf74a3860)
![David](https://img.shields.io/david/wmcadigital/wmca-design-system?style=flat-square)
![GitHub last commit](https://img.shields.io/github/last-commit/wmcadigital/wmca-design-system?style=flat-square)
![GitHub issues](https://img.shields.io/github/issues-raw/wmcadigital/wmca-design-system?style=flat-square)
[![Netlify Status](https://img.shields.io/netlify/04471bb6-9621-4c59-abe8-b4fdf74a3860)](https://app.netlify.com/sites/wmcads/deploys)
[![David](https://img.shields.io/david/dev/wmcadigital/wmca-design-system?style=flat-square)](https://github.com/wmcadigital/wmn-design-system/blob/master/package.json)
[![Last commit](https://img.shields.io/github/last-commit/wmcadigital/wmca-design-system?style=flat-square)](https://github.com/wmcadigital/wmca-design-system/commits/master)
[![Open Github issues](https://img.shields.io/github/issues-raw/wmcadigital/wmca-design-systemstyle=flat-square)](https://github.com/wmcadigital/wmca-design-system/issues)

## 1.1. Table of contents

<!-- TOC -->

- [1. WMCA Design System](#1-wmcads-design-system)
- [1. WMCA Design System](#1-wmca-design-system)
- [1.1. Table of contents](#11-table-of-contents)
- [1.2. Overview](#12-overview)
- [1.3. Quick start](#13-quick-start)
Expand Down
65 changes: 0 additions & 65 deletions RELEASE.md

This file was deleted.

0 comments on commit ef9151b

Please sign in to comment.