Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/moveoffjenkins #54

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
12a22d1
adding workflow and actions
Oct 18, 2021
d5aa2a2
github workflow for auto-semver
kayla-norris9 Oct 28, 2021
da9cb6f
clean up
kayla-norris9 Oct 28, 2021
e5f043f
testing test job
kayla-norris9 Oct 28, 2021
fbc45da
changing install
kayla-norris9 Oct 28, 2021
8bf0577
check out to master
Oct 28, 2021
fef7fa5
remove working directory
kayla-norris9 Oct 28, 2021
bef3f1e
remove old test
Oct 28, 2021
2da01bf
adding job dependencies
kayla-norris9 Oct 28, 2021
c4f8f3b
Merge branch 'task/moveoffjenkins' of github.com:RightBrain-Networks/…
kayla-norris9 Oct 28, 2021
693505e
adding job dependencies
kayla-norris9 Oct 28, 2021
7382c03
adding job dependencies correctly
kayla-norris9 Oct 28, 2021
23ac940
tweaking job dependencies
kayla-norris9 Oct 28, 2021
c7940b5
adding python action
kayla-norris9 Oct 28, 2021
2384049
adding python action
kayla-norris9 Oct 28, 2021
be8c6a4
modifying python dependency
kayla-norris9 Oct 29, 2021
2ef9536
modifying python dependency
kayla-norris9 Oct 29, 2021
ae7c332
adding release
kayla-norris9 Oct 29, 2021
f999872
directory fix
kayla-norris9 Nov 1, 2021
7476fcd
directory fix
kayla-norris9 Nov 1, 2021
1b11fc5
directory fix
kayla-norris9 Nov 1, 2021
56617b3
directory fix
kayla-norris9 Nov 1, 2021
b1425f6
git user fix
kayla-norris9 Nov 1, 2021
723ca50
git user fix
kayla-norris9 Nov 1, 2021
a97aa47
Merge branch 'task/moveoffjenkins' of github.com:RightBrain-Networks/…
kayla-norris9 Nov 1, 2021
1f79eaf
removing git creds
kayla-norris9 Nov 1, 2021
ae38ed1
using auto semver action
kayla-norris9 Nov 2, 2021
15da0ef
using auto semver action
kayla-norris9 Nov 2, 2021
b6da102
updating checkout action version
kayla-norris9 Nov 2, 2021
8bba254
updating checkout action version
kayla-norris9 Nov 2, 2021
66233a1
adding release
kayla-norris9 Nov 2, 2021
81a8e1c
adding release
kayla-norris9 Nov 2, 2021
3dca312
fixing version issue
kayla-norris9 Nov 2, 2021
7dbe57d
reordering
kayla-norris9 Nov 2, 2021
b1a348b
adding push tag
kayla-norris9 Nov 4, 2021
cc72214
adjusting checkout
kayla-norris9 Nov 4, 2021
ffe40ff
adding branch ref
kayla-norris9 Nov 4, 2021
d220437
debugging
kayla-norris9 Nov 4, 2021
c398721
adding test subprocesses
kayla-norris9 Nov 4, 2021
844f11d
adding tests back
kayla-norris9 Nov 4, 2021
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
74 changes: 74 additions & 0 deletions .github/workflows/auto-semver-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: auto-semver-actions
on: [push]
env:
GITHUB_URL: 'git@github.com:RightBrain-Networks/auto-semver.git'
GITHUB_KEY: 'rbn-ops github'

SERVICE: 'auto-semver'
SELF_SEMVER_TAG: "master"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ env.GITHUB_REF }}
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Run Auto-Semver
id: semver
uses: RightBrain-Networks/semver-action@1.0.0
with:
mode: set
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: build
run: |
python setup.py sdist
- name: test
run: |
python tests.py
working-directory: semver
CheckVersion:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Auto-Semver
id: semver
uses: RightBrain-Networks/semver-action@1.0.0
with:
mode: set
- name: Create Release
uses: actions/create-release@v1
if: steps['semver']['outputs']['RETURN_STATUS'] == '0'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
release_name: ${{ steps.semver.outputs.SEMVER_NEW_VERSION }}
body: Version ${{ steps.semver.outputs.SEMVER_NEW_VERSION }} released automatically by [RightBrain-Networks/auto-semver](https://github.com/RightBrain-Networks/auto-semver)
draft: false
prerelease: false
release:
runs-on: ubuntu-latest
needs: [CheckVersion, build]
steps:
- uses: actions/checkout@v2
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
level: minor
- uses: actions-ecosystem/action-push-tag@v1
with:
tag: ${{ steps.bump-semver.outputs.new_version }}
message: '${{ steps.bump-semver.outputs.new_version }}: PR #${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}'
9 changes: 3 additions & 6 deletions semver/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ def test_branch_maven_bad_branch(self):
subprocess.call(['git', 'checkout', '-b', 'test/branch'])
branch = get_version.get_version(version_format='maven')
self.assertEqual(branch, "test/branch")
def test_get_version_run(self):
create_git_environment()
val = subprocess.Popen(['python', '../get_version.py', '-d'], stdout=subprocess.PIPE,
stderr=open(os.devnull, 'wb'), cwd='.').stdout.read().decode('utf-8').rstrip()
self.assertEqual(val, "master")


class TestGetTagVersion(unittest.TestCase):
Expand Down Expand Up @@ -230,6 +225,8 @@ def create_git_environment():
subprocess.call(['rm', '-rf', './.git'])
subprocess.call(['git', 'init'])
subprocess.call(['touch', 'file.txt'])
subprocess.call(['git', 'config', '--global', 'user.name', 'unit-test'])
subprocess.call(['git', 'config', '--global', 'user.email', 'unit-test@rightbrainnetworks.com'])
subprocess.call(['git', 'add', 'file.txt'])
subprocess.call(['git', 'commit', '-m', 'file.txt'])
subprocess.call(['git', 'remote', 'add', 'origin', os.getcwd()+'/.git'])
Expand All @@ -243,4 +240,4 @@ def create_git_environment():
with open('.bumpversion.cfg', "w") as config:
config.write(config_data)
unittest.main()
os.chdir("..")
os.chdir("..")