@@ -17,20 +17,20 @@ jobs:
1717 runs-on : ubuntu-latest
1818 steps :
1919 - name : Check out code
20- uses : actions/checkout@v2
20+ uses : actions/checkout@v4
2121 - name : Set up Python 3.8
22- uses : actions/setup-python@v2
22+ uses : actions/setup-python@v5
2323 with :
2424 python-version : 3.8
2525 - name : Extract version
2626 id : extract_version
2727 run : |
2828 python -m pip install bump2version
29- echo -n "::set-output name=version::"
30- bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,
29+ NEXT_TAG=$(bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,)
30+ echo "version=$NEXT_TAG" >> $GITHUB_OUTPUT
3131 - name : Create Release
3232 id : create_release
33- uses : release-drafter/release-drafter@v5
33+ uses : release-drafter/release-drafter@v6
3434 env :
3535 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3636 with :
@@ -41,20 +41,19 @@ jobs:
4141 upload_url : ${{ steps.create_release.outputs.upload_url }}
4242 tag_name : ${{ steps.create_release.outputs.tag_name }}
4343
44- release_package :
45- needs : create_release
44+ lint :
4645 runs-on : ubuntu-latest
4746 steps :
4847 - name : Check out code
49- uses : actions/checkout@v2
48+ uses : actions/checkout@v4
5049 - name : Set up Python 3.8
51- uses : actions/setup-python@v2
50+ uses : actions/setup-python@v5
5251 with :
5352 python-version : 3.8
5453 - name : Install build dependencies
5554 run : |
5655 python -m pip install --upgrade pip
57- pip install --use-feature=2020-resolver -r requirements.txt -r requirements- dev.txt
56+ pip install -e ".[ dev]"
5857 - name : Linting
5958 run : |
6059 . venv/bin/activate
@@ -63,32 +62,58 @@ jobs:
6362 run : |
6463 . venv/bin/activate
6564 inv test
66- - name : Create release
65+
66+ build :
67+ needs : [create_release, lint]
68+ runs-on : ubuntu-latest
69+ steps :
70+ - name : Check out code
71+ uses : actions/checkout@v4
72+ - name : Set up Python 3.8
73+ uses : actions/setup-python@v5
74+ with :
75+ python-version : 3.8
76+ - name : Install build dependencies
77+ run : |
78+ python -m pip install --upgrade pip
79+ pip install -e ".[dev]"
80+ - name : Build
6781 run : |
6882 inv dist
69- - uses : actions/upload-artifact@v2
83+
84+ release_package :
85+ needs : [create_release, lint]
86+ runs-on : ubuntu-latest
87+ # TODO: Make sure this works, copied from best practices here
88+ # https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing
89+ environment :
90+ name : pypi
91+ url : https://pypi.org/p/epidatpy
92+ permissions :
93+ id-token : write
94+ steps :
95+ - uses : actions/upload-artifact@v4
7096 with :
7197 name : epidatpy
98+ path : dist/*.tar.gz
7299 - name : Upload Release Asset
73- uses : AButler/upload-release-assets@v2 .0
100+ uses : AButler/upload-release-assets@v3 .0
74101 with :
75102 files : " dist/*.tar.gz"
76103 repo-token : ${{ secrets.GITHUB_TOKEN }}
77104 release-tag : ${{ needs.create_release.outputs.tag_name }}
78105 - name : Publish a Python distribution to PyPI
79106 uses : pypa/gh-action-pypi-publish@release/v1
80107 with :
81- user : __token__
82- password : ${{ secrets.DELPHI_PYPI_PROD_TOKEN }}
83- skip_existing : true
108+ skip-existing : true
84109 # repository_url: https://test.pypi.org/legacy/
85110
86111 sync_dev :
87112 needs : correct_repository
88113 runs-on : ubuntu-latest
89114 steps :
90115 - name : Check out code
91- uses : actions/checkout@v2
116+ uses : actions/checkout@v4
92117 with :
93118 ref : dev
94119 ssh-key : ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }}
@@ -97,14 +122,14 @@ jobs:
97122 git fetch origin main:main
98123 git reset --hard main
99124 - name : Create pull request into dev
100- uses : peter-evans/create-pull-request@v3
125+ uses : peter-evans/create-pull-request@v6
101126 with :
102127 branch : bot/sync-main-dev
103128 commit-message : " chore: sync main-dev"
104129 base : dev
105130 title : " chore: sync main->dev"
106131 labels : chore
107- # reviewers:
108- assignees : melange396
132+ # reviewers:
133+ assignees : dshemetov
109134 body : |
110135 Syncing Main->Dev.
0 commit comments