Skip to content

Commit

Permalink
Merge pull request #48 from ASFHyP3/actions-upgrade
Browse files Browse the repository at this point in the history
Actions upgrade plus switch to pyproject.toml and src layout
  • Loading branch information
jhkennedy authored Oct 7, 2023
2 parents f70ea00 + 20a3061 commit b234b0d
Show file tree
Hide file tree
Showing 32 changed files with 173 additions and 308 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These owners will be requested for review when someone opens a pull request.
* @ASFHyP3/tools
35 changes: 0 additions & 35 deletions .github/PULL_REQUEST_TEMPLATE/release.md

This file was deleted.

8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "bumpless"
8 changes: 0 additions & 8 deletions .github/pull_request_template.md

This file was deleted.

28 changes: 0 additions & 28 deletions .github/queries/asssociated-pr.query.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/queries/pr-labels.query.yml

This file was deleted.

18 changes: 6 additions & 12 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Changelog updated?

on:
pull_request:
types:
Expand All @@ -9,16 +10,9 @@ on:
branches:
- main
- develop
jobs:
changelog-udated:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Changelog check
uses: Zomzog/[email protected]
with:
fileName: CHANGELOG.md
noChangelogLabel: bumpless
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Distribute to PyPI

on:
push:
tags:
- v*

jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]

distribute:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml

- name: Build distribution
id: build
run: |
python -m build
- name: upload to PyPI.org
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TOOLS_PYPI_PAK }}

verify-distribution:
runs-on: ubuntu-latest
needs:
- call-version-info-workflow
- distribute
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml

- name: Ensure mkdocs-asf-theme v${{ needs.call-version-info-workflow.outputs.version }}} is pip installable
run: |
python -m pip install mkdocs-asf-theme==${{ needs.call-version-info-workflow.outputs.version_tag }}
11 changes: 2 additions & 9 deletions .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,5 @@ on:
- main

jobs:
bump-labeled:
runs-on: ubuntu-latest
steps:
- name: Require Labels
uses: mheap/github-action-required-labels@v1
with:
mode: exactly
count: 1
labels: "major, minor, patch, bumpless"
call-labeled-pr-check-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
14 changes: 14 additions & 0 deletions .github/workflows/release-template-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
pull_request:
types:
- opened
branches:
- main

jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
permissions:
pull-requests: write
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 11 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,17 @@
name: Write release and finish
name: Create Release

on:
push:
tags:
- v*

- 'v*'

jobs:
finish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.TOOLS_BOT_PAK }}

- name: Create Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
ALLOW_TAG_PREFIX: "true"
RELEASE_NAME_PREFIX: "ASF MkDocs Theme "

- name: Attempt fast-forward develop from main
run: |
git fetch --prune
git checkout develop && git pull --ff-only
git merge --ff-only origin/main
git push
- name: Open PR to bring main back to develop
if: ${{ failure() }}
uses: repo-sync/pull-request@v2
with:
source_branch: main
destination_branch: develop
pr_title: Pulling ${{ github.ref }} into default
pr_body: Fast-forward of main to default failed!
pr_assignee: ${{ github.actor }}
pr_label: tools-bot
pr_draft: false
pr_allow_empty: true
github_token: ${{ secrets.TOOLS_BOT_PAK }}
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
release_prefix: HyP3-CI
release_branch: main # Optional; default shown
develop_branch: develop # Optional; default shown
sync_pr_label: tools-bot # Optional; default shown
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
103 changes: 0 additions & 103 deletions .github/workflows/tag-and-distribute.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Tag version

on:
push:
branches:
- main

jobs:
call-bump-version-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
Loading

0 comments on commit b234b0d

Please sign in to comment.