Skip to content

Commit b5c0fc6

Browse files
authored
Test Release (#11)
* Allowing spec of major and minor version * Adjusted value for github.base_ref * Release Debugging
1 parent f4dcd12 commit b5c0fc6

File tree

3 files changed

+50
-18
lines changed

3 files changed

+50
-18
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
2-
# Main workflow to build and release
2+
# Main workflow to build
33

4-
name: Main
4+
name: Build
55

66
#
77
# Operational Variables
@@ -29,12 +29,6 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131

32-
- name: Determine whether this is a release build
33-
if: ${{ github.event_name == 'pull_request' && github.base_ref == 'refs/heads/main' }}
34-
env:
35-
IS_RELEASE: "true"
36-
run: echo "We will be performing a release upon success"
37-
3832
- name: Pipeline Debugging
3933
run: |
4034
env
@@ -82,11 +76,3 @@ jobs:
8276
with:
8377
name: coverage
8478
path: build/coverage.xml
85-
86-
- name: Conditionally perform a release
87-
if: ${{ env.IS_RELEASE == 'true' }}
88-
uses: elgohr/Github-Release-Action@master
89-
env:
90-
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
91-
with:
92-
args: Creating release

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#
2+
# Workflow to release, triggered by a push onto the protected main branch
3+
4+
name: Release
5+
6+
#
7+
# Operational Variables
8+
9+
env:
10+
MAJOR: 0
11+
MINOR: 0
12+
PYTHON_VERSION: 3.9.6
13+
14+
#
15+
# Establish when the workflow is run
16+
17+
on:
18+
push:
19+
branches:
20+
- main
21+
22+
#
23+
# Workflow
24+
25+
jobs:
26+
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
31+
- name: Determine whether this is a release build
32+
run: echo "We will be performing a release upon success"
33+
34+
- name: Pipeline Debugging
35+
run: |
36+
env
37+
38+
- name: Checkout out our code
39+
uses: actions/checkout@v2
40+
41+
- name: Conditionally perform a release
42+
uses: elgohr/Github-Release-Action@master
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
45+
with:
46+
args: Creating release

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
# If we are running in the context of a GitHub action then we use the GITHUB_RUN_NUMBER
2929
# otherwise we will default to 0 for the micro version.
3030

31-
major = 0
32-
minor = 0
31+
major = os.environ['MAJOR'] if 'MAJOR' in os.environ else 0
32+
minor = os.environ['MINOR'] if 'MINOR' in os.environ else 0
3333
micro = os.environ['GITHUB_RUN_NUMBER'] if 'GITHUB_RUN_NUMBER' in os.environ else 0
3434
dev = '.dev0' if 'IS_RELEASE' not in os.environ else ''
3535

0 commit comments

Comments
 (0)