Remove unused GHAs (#1147)
This commit is contained in:
parent
4c3e99fec8
commit
ef39cdbf53
|
@ -1,85 +0,0 @@
|
|||
name: Draft release notes on tag
|
||||
on:
|
||||
create
|
||||
|
||||
jobs:
|
||||
draft_release_notes:
|
||||
if: github.event.ref_type == 'tag' && github.event.master_branch == 'master'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get milestone title
|
||||
id: milestoneTitle
|
||||
uses: actions/github-script@0.9.0
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
// Our tags are of the form vX.X.X and milestones don't have the "v"
|
||||
return '${{github.event.ref}}'.startsWith('v') ? '${{github.event.ref}}'.substring(1) : '${{github.event.ref}}';
|
||||
- name: Get milestone for tag
|
||||
id: milestone
|
||||
uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
const options = github.issues.listMilestonesForRepo.endpoint.merge({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'all'
|
||||
})
|
||||
|
||||
const milestones = await github.paginate(options)
|
||||
|
||||
const milestone = milestones.find( milestone => milestone.title == '${{steps.milestoneTitle.outputs.result}}' )
|
||||
|
||||
if (milestone) {
|
||||
return milestone.number
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
- name: Get pull requests for milestone
|
||||
if: fromJSON(steps.milestone.outputs.result)
|
||||
id: pulls
|
||||
uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
const options = github.pulls.list.endpoint.merge({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'closed'
|
||||
})
|
||||
|
||||
const pullRequests = await github.paginate(options)
|
||||
|
||||
return pullRequests.filter(pullRequest => pullRequest.merged_at
|
||||
&& pullRequest.milestone
|
||||
&& pullRequest.milestone.number == ${{steps.milestone.outputs.result}})
|
||||
- name: Generate release notes text
|
||||
if: fromJSON(steps.milestone.outputs.result)
|
||||
id: generate
|
||||
uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
result-encoding: string
|
||||
script: |
|
||||
var draftText = "# Improvements \n\n# Changes \n\n"
|
||||
for (let pull of ${{ steps.pulls.outputs.result }}) {
|
||||
draftText += "* " + pull.title + " #" + pull.number + " \n"
|
||||
}
|
||||
draftText += "\n# Fixes \n"
|
||||
return draftText
|
||||
- name: Create release notes
|
||||
if: fromJSON(steps.milestone.outputs.result)
|
||||
# can't use actions/create-release because it doesn't like the text coming from JS
|
||||
uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
await github.repos.createRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag_name: '${{ github.event.ref }}',
|
||||
name: '${{ steps.milestoneTitle.outputs.result }}',
|
||||
draft: true,
|
||||
body: `${{ steps.generate.outputs.result }}`
|
||||
})
|
|
@ -1,63 +0,0 @@
|
|||
name: Increment milestones on tag
|
||||
on:
|
||||
create
|
||||
|
||||
jobs:
|
||||
increment_milestone:
|
||||
if: github.event.ref_type == 'tag' && github.event.master_branch == 'master'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get milestone title
|
||||
id: milestoneTitle
|
||||
uses: actions/github-script@0.9.0
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
// Our tags are of the form vX.X.X and milestones don't have the "v"
|
||||
return '${{github.event.ref}}'.startsWith('v') ? '${{github.event.ref}}'.substring(1) : '${{github.event.ref}}';
|
||||
- name: Get milestone for tag
|
||||
id: milestone
|
||||
uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
const options = github.issues.listMilestonesForRepo.endpoint.merge({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'all'
|
||||
})
|
||||
|
||||
const milestones = await github.paginate(options)
|
||||
|
||||
const milestone = milestones.find( milestone => milestone.title == '${{steps.milestoneTitle.outputs.result}}' )
|
||||
|
||||
if (milestone) {
|
||||
return milestone.number
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
- name: Close milestone
|
||||
if: fromJSON(steps.milestone.outputs.result)
|
||||
uses: actions/github-script@0.9.0
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
await github.issues.updateMilestone({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'closed',
|
||||
milestone_number: ${{steps.milestone.outputs.result}}
|
||||
})
|
||||
- name: Get next minor version
|
||||
if: fromJSON(steps.milestone.outputs.result)
|
||||
id: semvers
|
||||
uses: WyriHaximus/github-action-next-semvers@0.1.0
|
||||
with:
|
||||
version: ${{steps.milestoneTitle.outputs.result}}
|
||||
- name: Create next milestone
|
||||
if: fromJSON(steps.milestone.outputs.result)
|
||||
uses: WyriHaximus/github-action-create-milestone@0.1.0
|
||||
with:
|
||||
title: ${{ steps.semvers.outputs.minor }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in New Issue