Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

feat: shipjs integration #331

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
feat: shipjs integration
Refs: #327
  • Loading branch information
subzero10 committed May 19, 2022
commit 2947f084c62fd557852a9eef9b0a1de1e9ec82a9
62 changes: 62 additions & 0 deletions .github/workflows/shipjs-manual-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Ship js Manual Prepare
on:
issue_comment:
types: [created]
jobs:
manual_prepare:
if: |
github.event_name == 'issue_comment' &&
(github.event.comment.author_association == 'member' || github.event.comment.author_association == 'owner') &&
startsWith(github.event.comment.body, '@shipjs prepare')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- uses: actions/setup-node@v1
- run: |
if [ -f "yarn.lock" ]; then
yarn install
else
npm install
fi
- run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- run: npm run release -- --yes --no-browse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}

create_done_comment:
if: success()
needs: manual_prepare
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "@${{github.actor}} `shipjs prepare` done"
})

create_fail_comment:
if: cancelled() || failure()
needs: manual_prepare
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "@${{github.actor}} `shipjs prepare` fail"
})
27 changes: 27 additions & 0 deletions .github/workflows/shipjs-schedule-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Ship js Schedule Prepare
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 8 * * 2"
jobs:
schedule_prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- uses: actions/setup-node@v1
- run: |
if [ -f "yarn.lock" ]; then
yarn install
else
npm install
fi
- run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- run: npm run release -- --yes --no-browse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
29 changes: 29 additions & 0 deletions .github/workflows/shipjs-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Ship js trigger
on:
pull_request:
types:
- closed
jobs:
build:
name: Release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- uses: actions/setup-node@v1
with:
registry-url: "https://registry.npmjs.org"
- run: |
if [ -f "yarn.lock" ]; then
yarn install
else
npm install
fi
- run: npx shipjs trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
11 changes: 0 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http:https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http:https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Update to @honeybadger-io/js@4
- Set peerDeps to react@18

## [2.0.1] - 2022-03-16
### Fixed
- Generate inline sources in source maps (fixes a source maps error with create-react-app v5) (#299)
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };