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

Update to use labelmerge v0.4.3 #50

Merged
merged 8 commits into from
Feb 15, 2023
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
2 changes: 0 additions & 2 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: author

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- kaitj
- tkkuehn
- ataha24
- Bradley-karat

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0
Expand Down
31 changes: 7 additions & 24 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,27 @@
name-template: $RESOLVED_VERSION
tag-template: v$RESOLVED_VERSION
filter-by-commitish: true

template: |
## Changes
$CHANGES
categories:
- title: 🚀 Features
labels:
- breaking
- enhancement
labels: [breaking, enhancement]
- title: 🐛 Bug Fixes
labels:
- bug
labels: [bug]
- title: 🧰 Maintenance
labels:
- maintenance
- test
labels: [maintenance, test]
- title: 📝 Documentation
labels:
- documentation

exclude-labels:
- skip_changelog

labels: [documentation]
exclude-labels: [skip_changelog]
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: \<*_& # You can add # and @ to disable mentions, and add ` to disable code blocks.

version-resolver:
# major:
# labels:
# - 'breaking'
minor:
labels:
- breaking
- enhancement
labels: [breaking, enhancement]
patch:
labels:
- maintenance
- bug
- test
- documentation
labels: [maintenance, bug, test, documentation]
default: patch
3 changes: 0 additions & 3 deletions .github/workflows/assign_reviewers.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
---
name: Assign reviewer

on:
pull_request_target:
types: [opened, ready_for_review]

jobs:
assign:
runs-on: ubuntu-latest
if: github.event.pull_request.assignee == null

steps:
- name: Assign reviewer
uses: kentaro-m/auto-assign-action@v1.2.4
Expand Down
140 changes: 66 additions & 74 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,66 @@
---
name: Bump version
on:
pull_request_target:
types: [closed]
jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout master branch
uses: actions/checkout@master
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: Update changelog
uses: release-drafter/release-drafter@v5
id: release-drafter
with:
commitish: ${{ github.event.pull_request.base.ref }}
env:
GITHUB_TOKEN: ${{ secrets.BP_PAT_TOKEN }}

- name: Get previous release version
run: |
echo "PREV_VER=$(cat pyproject.toml | grep -o -E '(version\s=\s)([[:punct:]])([0-9]+\.[0-9]+\.[0-9]+.+)([[:punct:]])' | cut -d ' ' -f 3 | tr -d '"')" >> $GITHUB_ENV

- name: Get previous bump version
env:
PREV_VER: ${{ env.PREV_VER }}
run: |
if [[ "$PREV_VER" != *"-pre."* ]]; then
echo "OLD_BUMP=0" >> $GITHUB_ENV
else
echo "OLD_BUMP=$(echo $PREV_VER | cut -d '.' -f 4)" >> $GITHUB_ENV
fi

- name: Bump version
env:
BUMP_VER: ${{ env.OLD_BUMP }}
run: |
echo "NEW_BUMP=$(($BUMP_VER + 1))" >> $GITHUB_ENV

- name: Set new release version
env:
RD_RELEASE: ${{ steps.release-drafter.outputs.name }}
run: |
if [ ! -z "$RD_RELEASE" ]; then
echo "NEW_RELEASE=$RD_RELEASE" >> $GITHUB_ENV
else
echo "NEW_RELEASE=0.1.0" >> $GITHUB_ENV
fi

- name: Update version in pyproject.toml
uses: jacobtomlinson/gha-find-replace@master
with:
include: pyproject.toml
find: version = "(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"
replace: version = "${{ env.NEW_RELEASE }}-pre.${{ env.NEW_BUMP }}"

- name: Commit updates
env:
SNAKEBIDS_VERSION: ${{ env.NEW_RELEASE }}-pre.${{ env.NEW_BUMP }}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff-index --quiet HEAD || git commit -m "Bump version to $SNAKEBIDS_VERSION" -a

- name: Push changes
uses: CasperWA/push-protected@v2
with:
branch: ${{ github.event.pull_request.base.ref }}
token: ${{ secrets.BP_PAT_TOKEN }}
unprotect_reviews: true
---
name: Bump version
on:
pull_request_target:
types: [closed]
jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout master branch
uses: actions/checkout@master
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Update changelog
uses: release-drafter/release-drafter@v5
id: release-drafter
with:
commitish: ${{ github.event.pull_request.base.ref }}
env:
GITHUB_TOKEN: ${{ secrets.BP_PAT_TOKEN }}
- name: Get previous release version
run: |
echo "PREV_VER=$(cat pyproject.toml | grep -o -E '(version\s=\s)([[:punct:]])([0-9]+\.[0-9]+\.[0-9]+.+)([[:punct:]])' | cut -d ' ' -f 3 | tr -d '"')" >> $GITHUB_ENV
- name: Get previous bump version
env:
PREV_VER: ${{ env.PREV_VER }}
run: |
if [[ "$PREV_VER" != *"-pre."* ]]; then
echo "OLD_BUMP=0" >> $GITHUB_ENV
else
echo "OLD_BUMP=$(echo $PREV_VER | cut -d '.' -f 4)" >> $GITHUB_ENV
fi
- name: Bump version
env:
BUMP_VER: ${{ env.OLD_BUMP }}
run: |
echo "NEW_BUMP=$(($BUMP_VER + 1))" >> $GITHUB_ENV
- name: Set new release version
env:
RD_RELEASE: ${{ steps.release-drafter.outputs.name }}
run: |
if [ ! -z "$RD_RELEASE" ]; then
echo "NEW_RELEASE=$RD_RELEASE" >> $GITHUB_ENV
else
echo "NEW_RELEASE=0.1.0" >> $GITHUB_ENV
fi
- name: Update version in pyproject.toml
uses: jacobtomlinson/gha-find-replace@master
with:
include: pyproject.toml
find: version = "(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"
replace: version = "${{ env.NEW_RELEASE }}-pre.${{ env.NEW_BUMP }}"
- name: Commit updates
env:
SNAKEBIDS_VERSION: ${{ env.NEW_RELEASE }}-pre.${{ env.NEW_BUMP }}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff-index --quiet HEAD || git commit -m "Bump version to $SNAKEBIDS_VERSION" -a
- name: Push changes
uses: CasperWA/push-protected@v2
with:
branch: ${{ github.event.pull_request.base.ref }}
token: ${{ secrets.BP_PAT_TOKEN }}
unprotect_reviews: true
71 changes: 32 additions & 39 deletions .github/workflows/deploy_docker.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,32 @@
---
name: Deploy docker container

on:
push:
tags:
- 'v*'

jobs:
deploy_docker:
name: Docker deploy
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- name: Checkout repo
uses: actions/checkout@master

- name: Get metadata
uses: docker/metadata-action@v4.1.1
id: metadata
with:
images: ${{ github.repository }}

- name: Login to Dockerhub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
---
name: Deploy docker container
on:
push:
tags: [v*]
jobs:
deploy_docker:
name: Docker deploy
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout repo
uses: actions/checkout@master
- name: Get metadata
uses: docker/metadata-action@v4.1.1
id: metadata
with:
images: ${{ github.repository }}
- name: Login to Dockerhub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
30 changes: 12 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,78 @@
---
name: Release package

on:
workflow_dispatch:
inputs:
comments:
description: "Comments"
description: Comments
required: false

jobs:
release_changelog:
runs-on: ubuntu-latest

runs-on: ubuntu-latest
steps:
- name: Print author
run: |
echo "Author: ${{ github.triggering_actor }}"
echo "Comments: ${{ github.event.inputs.comments }}"

- name: Extract branch name
shell: bash
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"

- uses: actions/checkout@master
with:
ref: ${{ steps.extract_branch.outputs.branch }}

- name: Draft change log
uses: release-drafter/release-drafter@v5
uses: release-drafter/release-drafter@v5
id: release-drafter
with:
commitish: ${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set new release version
env:
env:
RD_RELEASE: ${{ steps.release-drafter.outputs.name }}
run: |
if [ ! -z "$RD_RELEASE" ]; then
echo "NEW_RELEASE=$RD_RELEASE" >> $GITHUB_ENV
else
echo "NEW_RELEASE=0.1.0" >> $GITHUB_ENV
fi

- name: Update pipeline description
uses: jacobtomlinson/gha-find-replace@master
with:
include: 'scattr/pipeline_description.json'
include: scattr/pipeline_description.json
find: '"Version": "(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"'
replace: '"Version": "${{ env.NEW_RELEASE }}"'

- name: Update version in pyproject.toml
uses: jacobtomlinson/gha-find-replace@master
with:
include: pyproject.toml
find: version = "(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"
replace: version = "${{ env.NEW_RELEASE }}"

- name: Update container version
uses: jacobtomlinson/gha-find-replace@master
with:
include: scattr/config/snakebids.yml
find: 'scattr: "docker://khanlab/scattr:v(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"'
replace: 'scattr: "docker://khanlab/scattr:v${{ env.NEW_RELEASE }}"'
- name: Commit updates
env:
LATEST_VERSION: ${{ env.NEW_RELEASE }}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff-index --quiet HEAD || git commit -m "Bump version to $LATEST_VERSION" -a

- name: Push changes
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.BP_PAT_TOKEN }}
unprotect_reviews: true

- name: Publish change log
uses: release-drafter/release-drafter@v5
with:
commitish: ${{ steps.extract_branch_outputs.branch }}
publish: true
name: ${{ env.NEW_RELEASE }}
tag: "v${{ env.NEW_RELEASE }}"
tag: v${{ env.NEW_RELEASE }}
env:
GITHUB_TOKEN: ${{ secrets.BP_PAT_TOKEN }}
Loading