Skip to content

Commit

Permalink
Release workflow trigger changed to manual dispatch.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaskov committed Aug 17, 2023
1 parent 7c2af24 commit 60a1502
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
name: release

on:
pull_request_target:
types:
- closed
branches:
- master
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 }}
ref: master

- name: Create release branch
run: git checkout -b release/latest

- name: Set git user
run: |
Expand All @@ -32,22 +38,31 @@ jobs:

- name: Update version in package.json
run: |
npm version patch -m "patch release %s"
git status
npm version ${{ inputs.release_type }} -m "${{ inputs.release_type }} release %s"
- 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 NPM
# run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
- name: Publish package on NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

0 comments on commit 60a1502

Please sign in to comment.