Skip to content

Commit

Permalink
ci: adding new workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
q2d2 committed May 15, 2023
1 parent 46d9907 commit 6dc2ff1
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/increment-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Increment Release

on:
push:
branches:
- 'Release-*'

jobs:
increment_tag:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup
shell: bash
run: |
git config --global user.name "q2d2"
git config --global user.email "q2d2.noreply@gmail.com"
IFS='-' read -r _ release <<< $(git branch)
echo "release=$release" >> $GITHUB_ENV
echo "default_tag=$release.-1" >> $GITHUB_ENV
- name: Get last tag
id: get_last_tag
shell: bash
run: |
last_tag=$(git describe --abbrev=0 --tags 2>/dev/null || echo ${{ env.default_tag }})
echo "last_tag=$last_tag" >> "$GITHUB_ENV"
- name: Increment tag
id: increment_tag
shell: bash
run: |
last_tag=${{ env.last_tag }}
IFS='.' read -r major minor patch <<< "$last_tag"
incremented_tag="$major.$minor.$((patch + 1))"
echo "incremented_tag=$incremented_tag" >> "$GITHUB_ENV"
- name: Create new tag
shell: bash
run: |
git tag -a ${{ env.incremented_tag }} -m "${{ env.incremented_tag }}"
git push --follow-tags
33 changes: 33 additions & 0 deletions .github/workflows/join-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Join a QIIME 2 release

on:
workflow_dispatch: {}

env:
release: 'Release-2023.5'
tag: '2023.5.0.dev0'

jobs:
join:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.INSTALL_WORKFLOWS_PAT }}
path: ./current-repo

# Where it checks out master we will probably end up checking out dev
# since it sounds like we will be calling our main branches dev now.
- name: branch repo
shell: bash
run: |
cd ./current-repo
git config --global user.name "q2d2"
git config --global user.email "q2d2.noreply@gmail.com"
git checkout -b ${{ env.release }}
git commit --allow-empty -m "${{ env.release }}"
git push --set-upstream origin ${{ env.release }}
git checkout master
git commit --allow-empty -m "${{ env.release }}"
git tag -a ${{ env.tag }} -m "${{ env.tag }}"
git push --follow-tags

0 comments on commit 6dc2ff1

Please sign in to comment.