Skip to content

Commit

Permalink
Update release automation workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Jun 22, 2021
1 parent 9f6fa98 commit 667a496
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,41 @@ name: Create Release Pull Request
on:
workflow_dispatch:
inputs:
release-version:
description: 'A specific version to bump to.'
base-branch:
description: 'The base branch for git operations and the pull request.'
default: 'main'
required: true
release-type:
description: 'A SemVer version diff, i.e. major, minor, patch, prerelease etc. Mutually exclusive with "release-version".'
required: false
release-version:
description: 'A specific version to bump to. Mutually exclusive with "release-type".'
required: false

jobs:
monorepo-release-pr:
create-release-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v2
with:
# This is to guarantee that the most recent tag is fetched.
# This can be configured to a more reasonable value by consumers.
fetch-depth: 0
# We check out the specified branch, which will be used as the base
# branch for all git operations and the release PR.
ref: ${{ github.event.inputs.base-branch }}
- name: Get Node.js version
id: nvm
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
- uses: MetaMask/action-create-release-pr@v0.0.16
with:
release-version: ${{ github.event.inputs.release-version }}
- uses: MetaMask/action-create-release-pr@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release-type: ${{ github.event.inputs.release-type }}
release-version: ${{ github.event.inputs.release-version }}
10 changes: 7 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
types: [closed]

jobs:
release_merge:
publish-release:
permissions:
contents: write
if: |
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.head.ref, 'release-v')
startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -18,6 +20,8 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
- uses: MetaMask/action-publish-release@v0.0.3
- uses: MetaMask/action-publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release-branch-prefix: release/

0 comments on commit 667a496

Please sign in to comment.