-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
19 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 |
---|---|---|
@@ -1,24 +1,34 @@ | ||
name: release | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- closed | ||
branches: | ||
- master | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- '.clang-format' | ||
- '.gitignore' | ||
- 'README.md' | ||
workflow_dispatch: | ||
inputs: | ||
release_type: | ||
type: choice | ||
description: Release type | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
default: patch | ||
|
||
jobs: | ||
release: | ||
if: github.event.pull_request.merged == true | ||
runs-on: [ ubuntu-22.04 ] | ||
environment: prod | ||
|
||
steps: | ||
- name: Check out branch | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Create release branch | ||
run: git checkout -b release/latest | ||
|
||
- name: Set git user | ||
run: | | ||
|
@@ -32,20 +42,30 @@ jobs: | |
|
||
- name: Update version in package.json | ||
run: | | ||
npm version patch -m "patch release %s" | ||
npm version ${{ inputs.release_type }} -m "${{ inputs.release_type }} release %s" | ||
git status | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
- name: Push new branch | ||
run: git push origin release/latest | ||
|
||
- name: Create pull request into main | ||
uses: thomaseizinger/[email protected] | ||
with: | ||
branch: ${{ github.event.pull_request.head.ref }} | ||
tags: true | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
head: release/latest | ||
base: master | ||
title: Update version in package.json | ||
reviewers: ${{ github.event.issue.user.login }} | ||
body: | | ||
Hi! | ||
This PR was created in response workflow running. | ||
I've updated the version in package.json. | ||
- name: Publish package on GPR | ||
run: | | ||
npm config set registry https://npm.pkg.github.com | ||
npm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }} | ||
npm publish | ||
# - name: Publish package on GPR | ||
# run: | | ||
# npm config set registry https://npm.pkg.github.com | ||
# npm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }} | ||
# npm publish | ||
|
||
# - name: Publish package on NPM | ||
# run: npm publish | ||
|