Skip to content

Commit

Permalink
Merge pull request #158 from nanos/auto-tagging
Browse files Browse the repository at this point in the history
Update version string on tagged releases
  • Loading branch information
nanos authored Aug 15, 2024
2 parents df22348 + c4aaf79 commit 8ac868f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build-container.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Build Container

"on":
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
on:
workflow_run:
workflows: [Update Version number]
types:
- completed
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU

uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -24,6 +26,7 @@ jobs:
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/update-version-number.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update Version number

"on":
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout original repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Git
run: |
git config user.name nanos-bot
git config user.email bot@thms.uk
- name: Update version number
run: |
VERSION=${{ github.ref_name }}
VERSION="${VERSION:1}"
sed -i '' -E 's/VERSION = "[0-9]+.[0-9]+.[0-9]+"/VERSION = "'$VERSION'"/' find_posts.py
git add find_posts.py
git commit -m "[bot] Bump version to $VERSION"
- name: Push to repository
run: git push --quiet

0 comments on commit 8ac868f

Please sign in to comment.