Skip to content
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
14 changes: 12 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
description: 'Version to label the Docker image under'
required: true
type: string
workflow_call:
inputs:
version:
required: true
type: string

permissions:
contents: read
packages: write

jobs:
check_authorization:
Expand All @@ -25,13 +34,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/libretexts/molview-lambda-api:${{ inputs.version }}
41 changes: 41 additions & 0 deletions .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Version Bump and Build

on:
pull_request:
types: [closed]
branches: [main]

permissions:
contents: write

jobs:
bump:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ secrets.LIBREBOT_ACCESS_TOKEN }}
- name: Configure git as LibreBot
run: |
git config user.name "libretexts-bot"
git config user.email "dev@libretexts.org"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install bump-my-version
run: pip install bump-my-version
- name: Bump minor version
run: bump-my-version bump minor
- name: Capture new version
id: version
run: echo "value=$(bump-my-version show current_version)" >> "$GITHUB_OUTPUT"
build:
needs: bump
uses: ./.github/workflows/docker.yml
with:
version: ${{needs.bump.outputs.version}}
secrets: inherit
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[project]
name = "molview-lambda-api"
version = "1.10.0"

[tool.bumpversion]
current_version = "1.10.0"
commit = true
tag = true
commit_args = "-m 'chore(release): {new_version} [skip ci]'"
tag_name = "{new_version}"

[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'