Skip to content

Commit

Permalink
Move to trunk (#142)
Browse files Browse the repository at this point in the history
* move to trunk

* version retrieve change

* vbump and reverted some changes
  • Loading branch information
lexastr authored May 7, 2024
1 parent d9ed6e8 commit caaeeef
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 6 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/check-new-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# check-new-tag.yml

name: Check for new tags
on:
push:
branches:
- master
- pre/*
- post/*

jobs:
check-tag:
permissions:
contents: write

name: check for new tags
runs-on: ubuntu-latest

steps:
- name: check for new version
id: check-tag
uses: biocatchltd/gh-actions-is-new-version@main

- name: release a new version
if: steps.check-tag.outputs.is-new == 'true'
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.check-tag.outputs.release-notes }}
tag_name: ${{ steps.check-tag.outputs.found-version }}
target_commitish: ${{ github.sha }}
prerelease: ${{ steps.check-tag.outputs.is-prerelease }}
token: ${{ secrets.BC_AUTOMATIONS_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/label-bump-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# label-bump-prs.yml
name: Handle VLock PRs

on:
pull_request:
types: [opened, reopened, edited, synchronize]
branches:
- master

jobs:
label-vlock-prs:
name: Handle Version Lock PRs
runs-on: ubuntu-latest
steps:
- name: check for new version
id: check-tag
uses: biocatchltd/gh-actions-is-new-version@main

- name: label prs
if: steps.check-tag.outputs.is-new == 'true'
uses: actions-ecosystem/action-add-labels@v1
with:
labels: version-lock

- name: check that vlock prs are good to release
if: steps.check-tag.outputs.is-new == 'true'
run: |
pip install --upgrade pip setuptools
pip install poetry==1.7.1
sh scripts/check-version.sh
- name: check no other version locks
id: check-vlock
if: steps.check-tag.outputs.is-new != 'true'
uses: juliangruber/find-pull-request-action@v1
with:
labels: version-lock
base: master

- name: block if vlock in progress
if: steps.check-tag.outputs.is-new != 'true'
uses: biocatchltd/gh-actions-block-with-comment@main
with:
fail-message: |
Version lock in progress. Please wait for it to close before merging (#${{steps.check-vlock.outputs.number}}).
comment_tag: version-lock
test: ${{steps.check-vlock.outputs.state != 'open'}}
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ jobs:
echo toml "$TOML_VER"
GIT_VER=${{ github.event.release.tag_name }}
echo git "$GIT_VER"
LIB_VER=$(python -c "exec(open('yellowbox/_version.py').read()); print(__version__)")
echo lib "$LIB_VER"
[[ "$TOML_VER" == "$GIT_VER" ]]
[[ "$TOML_VER" == "$LIB_VER" ]]
echo "__version__ = \"$GIT_VER\"" > yellowbox/_version.py
- name: Publish
env:
PYPI_USERNAME: ${{ secrets.pypi_user }}
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Yellowbox Changelog
## NEXT
## 0.8.8
### Changed
* moved to trunk
* connecting container to network now has a fallback if `Alias` field is empty to `DNSNames`
### Removed
* dropped support for python 3.7
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "yellowbox"
version = "0.8.7"
version = "0.8.8"
description = ""
authors = ["biocatch ltd"]
license = "MIT"
Expand Down
18 changes: 18 additions & 0 deletions scripts/check-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
# checks that a version is ready to be released
set -e

if ls newsfragments/*.md 2> /dev/null; then
echo "Unbuilt newsfragments exist, exiting" && exit 1
fi

CL_VERSION=$(awk '/^## \[(.+)\]|[0-9.]+/ {print gensub(/(\[(.+)\]|([0-9.]+)).*$/, "\\2\\3", "g", $2); exit}' CHANGELOG.md)
if [ -z "$CL_VERSION" ]; then
echo "Could not find version in CHANGELOG.md" && exit 1
fi

TOML_VERSION=$(poetry version | cut -d' ' -f2)

if [ "$CL_VERSION" != "$TOML_VERSION" ]; then
echo "Version mismatch between CHANGELOG.md and pyproject.toml ($CL_VERSION vs $TOML_VERSION)" && exit 1
fi
2 changes: 1 addition & 1 deletion yellowbox/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.8.7"
__version__ = ""

0 comments on commit caaeeef

Please sign in to comment.