Add workflows to create software PRs and GitHub releases (#1123)
* Add workflows to create software PR and release * Fix job names * Minor fix * Rework workflows
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
name: Create GitHub release
|
||||||
|
|
||||||
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
types: [create-github-release]
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Create release for ${{ github.event.client_payload.ReleaseBranchName }}
|
||||||
|
uses: actions/[email protected]
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.event.client_payload.ReleaseBranchName }}
|
||||||
|
release_name: ${{ github.event.client_payload.ReleaseTitle }}
|
||||||
|
body: ${{ github.event.client_payload.ReleaseBody }}
|
||||||
|
prerelease: ${{ github.event.client_payload.Prerelease }}
|
||||||
|
commitish: ${{ github.event.client_payload.Commitish }}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
name: Create Pull Request
|
||||||
|
|
||||||
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
types: [create-pr]
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Create pull request for ${{ github.event.client_payload.ReleaseBranchName }}
|
||||||
|
uses: actions/github-script@v2
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
github.pulls.create({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
title: "${{ github.event.client_payload.PullRequestTitle }}",
|
||||||
|
head: "${{ github.event.client_payload.ReleaseBranchName }}",
|
||||||
|
base: "${{ github.event.client_payload.PullRequestBase }}",
|
||||||
|
body: `${{ github.event.client_payload.PullRequestBody }}`
|
||||||
|
});
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
name: Merge pull request
|
||||||
|
|
||||||
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
types: [merge-pr]
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Merge pull request for ${{ github.event.client_payload.ReleaseBranchName }}
|
||||||
|
uses: actions/github-script@v2
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
github.pulls.merge({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
pull_number: ${{ github.event.client_payload.PullRequestNumber }}
|
||||||
|
})
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
name: Update release
|
||||||
|
|
||||||
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
types: [update-github-release]
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Update release for ${{ github.event.client_payload.ReleaseBranchName }}
|
||||||
|
uses: actions/github-script@v2
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
const response = await github.repos.getReleaseByTag({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
tag: "${{ github.event.client_payload.ReleaseBranchName }}"
|
||||||
|
});
|
||||||
|
github.repos.updateRelease({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
release_id: response.data.id,
|
||||||
|
prerelease: ${{ github.event.client_payload.Prerelease }}
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user