Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
mod release flow (#19)
Browse files Browse the repository at this point in the history
* feat: mod package.json

* feat: add actions for shipjs
  • Loading branch information
nabeen authored Aug 4, 2020
1 parent 5aa9e36 commit bb6dab9
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 2 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/shipjs-manual-prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: comment "@${{ github.actor }} `shipjs prepare` done"

create_fail_comment:
if: cancelled() || failure()
needs: manual_prepare
runs-on: ubuntu-latest
steps:
- uses: actions/github@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: comment "@${{ github.actor }} `shipjs prepare` fail"
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://npm.pkg.github.com/"
- run: |
if [ -f "yarn.lock" ]; then
yarn install
else
npm install
fi
- run: npx shipjs trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "gridsome-source-google-analytics-reporting-api",
"name": "@hasigo/gridsome-source-google-analytics-reporting-api",
"version": "0.0.4",
"description": "Gridsome Source for Google Analytics Reporting API",
"repository": "hasigo/gridsome-source-google-analytics-reporting-api",
"repository": "git://github.com/hasigo/gridsome-source-google-analytics-reporting-api.git",
"main": "gridsome.server.js",
"keywords": [
"gridsome",
"gridsome-plugin",
"analytics",
"reporting"
],
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"author": "nabeen <[email protected]>",
"license": "MIT",
"scripts": {
Expand Down

0 comments on commit bb6dab9

Please sign in to comment.