Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/skyscanner/eslint-co…
Browse files Browse the repository at this point in the history
…nfig-skyscanner-15.1.0
  • Loading branch information
olliecurtis authored Jul 24, 2023
2 parents 8233282 + c47a330 commit 4921899
Show file tree
Hide file tree
Showing 7 changed files with 257 additions and 33 deletions.
29 changes: 29 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
- title: 'Breaking'
label: 'major'
- title: 'Added'
label: 'minor'
- title: 'Fixed'
label: 'patch'
- title: 'Dependency updates'
label: 'dependencies'
exclude-labels:
- 'skip-changelog'
- 'github_actions'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
- 'dependencies'
default: patch
template: |
## What’s Changed
$CHANGES
36 changes: 36 additions & 0 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test

on:
workflow_call:

defaults:
run:
shell: bash -l {0}

env:
CACHE_NAME: node-modules-cache

jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Restore Cache
uses: actions/cache/[email protected]
id: npm-cache
with:
path: |
node_modules/
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json') }}

- name: Run linters
run: npm run lint

- name: Test
run: npm test
33 changes: 0 additions & 33 deletions .github/workflows/ci.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/label-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: label-check

on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]

jobs:
label-check:
runs-on: ubuntu-latest

steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
one_of: major,minor,patch,dependencies,skip-changelog
repo_token: ${{ secrets.GITHUB_TOKEN }}
57 changes: 57 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Main

on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

env:
CACHE_NAME: node-modules-cache

jobs:
Create-NPM-Cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Upload to Cache
uses: actions/[email protected]
id: npm-cache
with:
path: |
node_modules/
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }}
run: npm ci

Run-Tests:
permissions:
statuses: write
pull-requests: write
needs: [Create-NPM-Cache]
uses: ./.github/workflows/_test.yml

ReleaseDraft:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- name: Draft release notes
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PR

on:
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

env:
CACHE_NAME: node-modules-cache

jobs:
Create-NPM-Cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Upload to Cache
uses: actions/[email protected]
id: npm-cache
with:
path: |
node_modules/
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }}
run: npm ci

Run-Tests:
permissions:
statuses: write
pull-requests: write
needs: [Create-NPM-Cache]
uses: ./.github/workflows/_test.yml
74 changes: 74 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: release

on:
release:
types: [published]

defaults:
run:
shell: bash -l {0}

env:
CACHE_NAME: node-modules-cache

jobs:
Create-NPM-Cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Upload to Cache
uses: actions/[email protected]
id: npm-cache
with:
path: |
node_modules/
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }}
run: npm ci

Run-Tests:
permissions:
statuses: write
pull-requests: write
needs: [Create-NPM-Cache]
uses: ./.github/workflows/_test.yml

Release:
name: Release @skyscanner/eslint-config-skyscanner to NPM
runs-on: ubuntu-latest
environment: Publishing
needs: [Create-NPM-Cache, Run-Tests]
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
ref: main

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Restore Cache
uses: actions/cache/[email protected]
id: npm-cache
with:
path: |
node_modules/
key: ${{ env.CACHE_NAME }}-${{ hashFiles('package-lock.json') }}

- name: Publish NPM package
run: |
npm version $RELEASE_VERSION --no-git-tag-version
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
RELEASE_VERSION: ${{ github.event.release.tag_name }}

0 comments on commit 4921899

Please sign in to comment.