-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automatically create tag based on __version__ (#3)
Use GitHub action to automatically create tag based on `__version__`
- Loading branch information
1 parent
4ce38d7
commit 8055690
Showing
5 changed files
with
105 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: on_new_tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
check_ver: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
python-version: [ 3.11 ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Installing Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Check tag matches version | ||
run: | | ||
[[ $(python3 -m GradescopeGrader version) == ${GITHUB_REF#refs/tags/v} ]] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: test_and_release | ||
|
||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
|
||
jobs: | ||
test_and_release: | ||
name: Unit Testing and then Release | ||
|
||
strategy: | ||
matrix: | ||
os: [ ubuntu-22.04 ] | ||
python-version: [ 3.11 ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Installing Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Run Unit Testing | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
python3 runtests.py | ||
- name: Test setup.py | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
python3 -m pip install ${{ github.workspace }} | ||
- name: Installing GitHubApiHelper | ||
run: | | ||
python3 -m pip install git+https://github.com/zhenghaven/[email protected] | ||
- name: Get latest version | ||
id: latest_ver | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
python3 -m GitHubApiHelper --auth-token \ | ||
api_tags_latest_ver \ | ||
--repo ${{ github.repository }} \ | ||
-l $(python3 -m GradescopeGrader version) \ | ||
--github-out | ||
- name: Create tag | ||
if: ${{ startsWith(github.ref, 'refs/heads/main') && steps.latest_ver.outputs.remote != steps.latest_ver.outputs.all }} | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/${{ steps.latest_ver.outputs.allV }}', | ||
sha: context.sha | ||
}) | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
|
||
|
||
__version__ = '0.1.0' | ||
__version__ = '0.1.2' | ||
|
||
PKG_AUTHOR = 'Haofan Zheng' | ||
PKG_NAME = 'GradescopeGrader' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters