-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #204 from iterative/use-simple-setup
- Loading branch information
Showing
5 changed files
with
133 additions
and
1,155 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,59 @@ | ||
name: Create Release PR | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
type: choice | ||
description: 'version to bump' | ||
required: true | ||
options: | ||
[ | ||
'patch', | ||
'minor', | ||
'major', | ||
'prepatch', | ||
'preminor', | ||
'premajor', | ||
'prerelease' | ||
] | ||
default: 'patch' | ||
|
||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
bump-version-create-pr: | ||
if: github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Bump and create PR | ||
run: | | ||
yarn workspace @dvcorg/gatsby-theme-iterative version --${{ github.event.inputs.version }} --no-git-tag-version | ||
VERSION=$(jq -r '.version' < packages/gatsby-theme-iterative/package.json) | ||
git checkout -b bump/v${VERSION} | ||
git push --set-upstream origin HEAD | ||
gh pr create --title "Bump version to v${VERSION}" --body "Approve me 🤖" | ||
gh pr merge --auto --squash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
create-release: | ||
if: github.event.pull_request.merged && startsWith(github.head_ref, 'bump/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: > | ||
gh release create v$(basename ${{github.head_ref }}) --generate-notes | ||
--draft | ||
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 |
---|---|---|
@@ -1,53 +1,19 @@ | ||
name: Publish Package to npmjs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
type: choice | ||
description: 'Version to publish' | ||
required: true | ||
options: ['patch', 'minor', 'major', 'pre'] | ||
default: 'patch' | ||
dry-run: | ||
type: boolean | ||
description: 'Dry run' | ||
required: false | ||
default: false | ||
|
||
release: | ||
types: [created] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Git config | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
registry-url: 'https://registry.npmjs.org' | ||
scope: '@dvcorg' | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: | | ||
yarn install --frozen-lockfile | ||
- run: | | ||
yarn release:ci ${{ github.event.inputs.version }} --dry-run=${{ github.event.inputs.dry-run }} | ||
if [ "${{ github.event.inputs.dry-run }}" = "false" ]; then | ||
cd ./packages/gatsby-theme-iterative | ||
yarn publish | ||
fi | ||
cd ./packages/gatsby-theme-iterative | ||
yarn publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Oops, something went wrong.