-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding automation to release s-p-b (#41)
- Loading branch information
1 parent
c7ef4e6
commit 6089a1e
Showing
8 changed files
with
263 additions
and
28 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
time: "10:00" | ||
open-pull-requests-limit: 10 | ||
versioning-strategy: increase |
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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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: Test | ||
run: npm test |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -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 }} |
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 |
---|---|---|
@@ -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 }} |
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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -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-plugin-backpack 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 }} |