Skip to content

Commit 4cb8817

Browse files
authored
48 auto release verion on merge to main (#51)
* changed: simplified docker build workflow * added: release on main workflow
1 parent 90654f3 commit 4cb8817

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.github/workflows/docker-image.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: Create and publish a Docker image
33
# Configures this workflow to run every time a change is pushed to the branch called `release`.
44
on:
55
push:
6-
branches: [ "dev"]
7-
pull_request_target:
8-
types:
9-
- closed
106
branches: [ "main","dev" ]
117

128
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
@@ -17,7 +13,6 @@ env:
1713
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
1814
jobs:
1915
build-and-push-image:
20-
if: ${{ (github.event.pull_request.merged == true) || (github.ref_name == 'dev') }}
2116
runs-on: ubuntu-latest
2217
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
2318
permissions:
@@ -52,7 +47,7 @@ jobs:
5247
tags: |
5348
type=raw,value=latest,enable=${{ github.base_ref == 'main' }}
5449
type=semver,pattern={{version}},value=${{ env.VER }},enable=${{ github.base_ref == 'main' }}
55-
type=raw,value=dev,enable=${{ (github.base_ref == 'dev') || (github.ref_name == 'dev') }}
50+
type=raw,value=dev,enable=${{ (github.base_ref == 'dev') }}
5651
5752
# js: added in for multi arch building
5853
- name: Set up QEMU
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
push:
3+
branches: ["main"]
4+
5+
name: Create Release
6+
7+
jobs:
8+
build:
9+
name: Create Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
- name: set VER
15+
run: echo "VER=$(awk -F \" '/version/ {print $2 }' pyproject.toml)" >> $GITHUB_ENV
16+
- name: Create Release
17+
id: create_release
18+
uses: actions/create-release@v1
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
21+
with:
22+
tag_name: ${{ env.VER }}
23+
release_name: Release ${{ env.VER }}
24+
draft: false
25+
prerelease: false

0 commit comments

Comments
 (0)