Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Split actions workflow between CI and Release #156

Merged
merged 10 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 15 additions & 46 deletions .github/workflows/afids-validator_ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AFIDs Validator CI/CD Workflow
name: AFIDs Validator CI Workflow

on:
pull_request:
Expand Down Expand Up @@ -112,58 +112,27 @@ jobs:
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

bump_version:
name: Draft and update release
draft_changelog:
name: Draft and update change log
needs: [linting]
runs-on: ubuntu-latest

steps:
- name: Draft and update change log
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy:
name: Deploy and release
needs: [test]
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true

steps:
- name: Checkout master
uses: actions/checkout@master
with:
ref: refs/heads/master

- name: Deploy heroku app
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} # Heroku API Key
heroku_app_name: afids-validator # Heroku app name
heroku_email: ${{ secrets.HEROKU_EMAIL }} # Heroku email

- name: Publish change log
id: update_version
- name: Draft and update change log
uses: release-drafter/release-drafter@v5
with:
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update setup.py version
uses: jacobtomlinson/gha-find-replace@master
with:
include: "setup.py"
find: "v[0-9]+.[0-9]+.[0-9]+"
replace: "${{ steps.update_version.outputs.tag_name }}"

- name: Commit setup.py
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Update setup.py version" -a
deploy_test:
name: Deploy test heroku app
needs: [linting]
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true

- name: Push to master
uses: ad-m/github-push-action@master
steps:
- name: Deploy test heroku app
uses: akhileshns/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: afids-validator-test
heroku_email: ${{ secrets.HEROKU_EMAIL }}
46 changes: 46 additions & 0 deletions .github/workflows/afids-validator_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: AFIDs Validator Release

on:
release:
types: [published]

jobs:
deploy:
name: Deploy and release
runs-on: ubuntu-latest

steps:
- name: Checkout latest tag
id: semver_checkout
uses: EasyDesk/action-semver-checkout@v1

- name: Update setup.py version
uses: jacobtomlinson/gha-find-replace@master
with:
include: "setup.py"
find: "v[0-9]+.[0-9]+.[0-9]+"
replace: "v${{ steps.semver_checkout.outputs.version }}"

- name: Commit setup.py
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Update setup.py version" -a

- name: Push to master
uses: ad-m/github-push-action@master
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Modify release to match release versions
run: |
git tag -a v${{ steps.semver_checkout.outputs.version }}
git push
git push origin -f v${{ steps.semver_checkout.outputs.version }}

- name: Deploy heroku app
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: afids-validator
heroku_email: ${{ secrets.HEROKU_EMAIL }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__pycache__/
*.pyc
.*env/
.env
.vscode/
afids.code-workspace
*.egg-info
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[![AFIDs](https://github.com/afids/afids-validator/blob/master/afidsvalidator/static/images/banner.png)](./static/images/banner.png)

[![](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2Fafids_project)](https://twitter.com/afids_project)
[![AFIDs Validator CI/CD](https://github.com/afids/afids-validator/actions/workflows/afids-validator_ci.yml/badge.svg)](https://github.com/afids/afids-validator/actions/workflows/afids-validator_ci.yml)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![AFIDs Validator CI](https://github.com/afids/afids-validator/actions/workflows/afids-validator_ci.yml/badge.svg)](https://github.com/afids/afids-validator/actions/workflows/afids-validator_ci.yml)
[![AFIDs Validator Release](https://github.com/afids/afids-validator/actions/workflows/afids-validator_release.yml/badge.svg)](https://github.com/afids/afids-validator/actions/workflows/afids-validator_release.yml)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/afids/afids-validator?sort=semver)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Anatomical fiducials (AFIDs) is an open framework for evaluating correspondence in brain images and teaching neuroanatomy using anatomical fiducial placement. The AFIDs Validator project aims to build a web application that allows the user to upload an FCSV file generated using the AFIDs protocol, and validate that it conforms to the protocol.
Expand Down