Skip to content

Commit

Permalink
chore: update workflows (#206)
Browse files Browse the repository at this point in the history
* chore: fix push tag workflow to get version

* chore: add asset path for wheel upload

* chore: add workflow to prioritize issues

* chore: update workflow to use endsWith
  • Loading branch information
weibullguy committed May 5, 2023
1 parent 89af593 commit c783757
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ exclude-labels:
- 'S: invalid'
- 'S: merged'
- 'S: wontfix'
include-pre-releases: false
template: |
## What Changed
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/do-prioritize-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow runs daily at noon.
#
# - Get list of labels.
# - Determine issue priority based on labels:
# - C: convention && P: bug --> U: high
# - C: style && P: bug --> U: medium
# - C: stakeholder && P:bug --> U: medium
# - C: convention && P: enhancement --> U: medium
# - C: style && P: enhancement --> U: low
# - C: stakeholder && P: enhancement --> U: low
# - chore || P: docs --> U: low
name: Prioritize Issues Workflow

on:
schedule:
cron: '00 12 * * *'

jobs:
prioritize_issues:
runs-on: ubuntu-latest
steps:
- name: Get Issue Labels
id: getlabels
uses: snnaplab/get-labels-action@v1

- name: Add High Urgency Labels
if: (endsWith(steps.getlabels.outputs.labels, ' convention ') && endsWith(steps.getlabels.outputs.labels, ' bug '))
uses: andymckay/labeler@master
with:
add-labels: "U: high"

- name: Add Medium Urgency Labels
if: (endsWith(steps.getlabels.outputs.labels, ' style ') && endsWith(steps.getlabels.outputs.labels, ' bug ')) || (endsWith(steps.getlabels.outputs.labels, ' stakeholder ') && endsWith(steps.getlabels.outputs.labels, ' bug ')) || (endsWith(steps.getlabels.outputs.labels, ' convenction ') && endsWith(steps.getlabels.outputs.labels, ' enhancement '))
uses: andymckay/labeler@master
with:
add-labels: "U: medium"

- name: Add Low Urgency Labels
if: (endsWith(steps.getlabels.outputs.labels, ' style ') && endsWith(steps.getlabels.outputs.labels, ' enhancement ')) || (endsWith(steps.getlabels.outputs.labels, ' stakeholder ') && endsWith(steps.getlabels.outputs.labels, ' enhancement ')) || endsWith(steps.getlabels.outputs.labels, ' doc ') || contains(steps.getlabels.outputs.labels, ' chore ')
uses: andymckay/labeler@master
with:
add-labels: "U: low"
13 changes: 7 additions & 6 deletions .github/workflows/do-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# - Upload the wheel to the new GitHub release.
# - Upload wheel to Test PyPi if build succeeds. (Future)
# - Test install from Test PyPi. (Future)
# - Upload wheel to PyPi if test install succeeds. (Future)
# - Upload wheel to PyPi if install test succeeds. (Future)
name: Do Release Workflow

on:
Expand Down Expand Up @@ -47,10 +47,10 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: "v1.3.1"
excludeTags: "latest"
excludeTagsRegex: "-rc[0-9]"
breakingLabel: "Breaking Changes"
breakingLabels: "V: major"
enhancementLabel: "New Features"
enhancementLabel: "Features"
enhancementLabels: "P: enhancement"
bugsLabel: "Bug Fixes"
bugLabels: "P: bug"
Expand Down Expand Up @@ -96,9 +96,9 @@ jobs:
if: ${{ env.build_ok == 1 }}
uses: release-drafter/release-drafter@v5
with:
name: "${{ steps.newversion.outputs.new_tag }}"
tag: "${{ steps.newversion.outputs.new_tag }}"
version: "${{ steps.newversion.outputs.new_tag }}"
name: "${{ steps.relversion.outputs.new_tag }}"
tag: "${{ steps.relversion.outputs.new_tag }}"
version: "${{ steps.relversion.outputs.new_tag }}"
prerelease: false
publish: true
env:
Expand All @@ -118,6 +118,7 @@ jobs:
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.cutrelease.outputs.upload_url }}
asset_path: ./dist/*.whl

# - name: Publish to Test PyPi
# if: ${{ env.build_ok == 1 }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/on-issue-open.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This workflow runs when a new issue is opened.
#
# - Apply the 'fresh' label.
name: Issue Open Workflow

on:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on-push-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
id: newversion
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=$(echo $new_tag | sed 's/.rc[0-9]*//')
version=$(echo $tag | sed 's/-rc[0-9]*//')
if [[ $tag != *"-rc"* ]]; then
echo "do_milestones=1" >> $GITHUB_ENV
echo "tag=$(echo $tag)" >> $GITHUB_OUTPUT
Expand All @@ -49,7 +49,7 @@ jobs:
if: ${{ env.do_milestones == 1 }}
uses: WyriHaximus/github-action-close-milestone@master
with:
number: ${{ steps.relversion.outputs.version }}
number: ${{ steps.newversion.outputs.version }}

- name: Create new minor release milestone
if: ${{ env.do_milestones == 1 }}
Expand Down

0 comments on commit c783757

Please sign in to comment.