-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add submodule update to release action
- Loading branch information
1 parent
edbb2f9
commit a64e806
Showing
1 changed file
with
23 additions
and
22 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 |
---|---|---|
|
@@ -47,6 +47,7 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
path: dandischema | ||
token: ${{ secrets.DANDI_GITHUB_TOKEN }} | ||
|
||
|
@@ -73,25 +74,18 @@ jobs: | |
fi | ||
echo "SCHEMA_VERSION=$SCHEMA_VERSION" >> "$GITHUB_ENV" | ||
- name: Checkout dandi/schema | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: dandi/schema | ||
path: schema | ||
token: ${{ secrets.DANDI_GITHUB_TOKEN }} | ||
|
||
- name: Test for unversioned changes | ||
run: | | ||
dirs="$(echo releases/*)" | ||
echo "Following directories will be checked for differences: $dirs" | ||
python ../dandischema/tools/pubschemata.py releases | ||
python ../../tools/pubschemata.py releases | ||
git status | ||
git add -A releases | ||
if ! git diff --cached --exit-code $dirs | ||
then echo "[ERROR] Existing schema files modified instead of creating a new version" | ||
exit 1 | ||
fi | ||
working-directory: schema | ||
working-directory: dandischema/dandischema/schema | ||
|
||
- name: Install build & twine | ||
run: python -m pip install build twine | ||
|
@@ -102,20 +96,11 @@ jobs: | |
wget -O- "$auto_download_url" | gunzip > ~/auto | ||
chmod a+x ~/auto | ||
- name: Create release | ||
run: | | ||
~/auto shipit -vv | ||
python -m build | ||
twine upload dist/* | ||
env: | ||
GH_TOKEN: ${{ secrets.DANDI_GITHUB_TOKEN }} | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
working-directory: dandischema | ||
- name: Commit schema changes and create new tag | ||
run: | | ||
LIBRARY_VERSION="$(git -C ../dandischema describe --tags --exact-match)" | ||
# TODO | ||
LIBRARY_VERSION="$(auto shipit --dry-run | grep for version)" | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "DANDI Bot" | ||
|
@@ -124,10 +109,26 @@ jobs: | |
if ! git diff --quiet --cached | ||
then git commit -m "Publish model schema v$SCHEMA_VERSION as of dandischema v$LIBRARY_VERSION" | ||
git push | ||
git -C ../dandischema tag -m "Schema v$SCHEMA_VERSION, released in dandischema v$LIBRARY_VERSION" schema-$SCHEMA_VERSION | ||
git -C ../dandischema push --tags | ||
else echo "No changes to commit" | ||
fi | ||
working-directory: schema | ||
|
||
- name: Update schema submodule with new release | ||
run: | | ||
git submodule update | ||
git commit -m "Schema v$SCHEMA_VERSION, released in dandischema v$LIBRARY_VERSION" schema-$SCHEMA_VERSION | ||
git tag -m "Schema v$SCHEMA_VERSION, released in dandischema v$LIBRARY_VERSION" schema-$SCHEMA_VERSION | ||
git push --tags | ||
working-directory: dandischema | ||
|
||
- name: Create release | ||
run: | | ||
~/auto shipit -vv | ||
python -m build | ||
twine upload dist/* | ||
env: | ||
GH_TOKEN: ${{ secrets.DANDI_GITHUB_TOKEN }} | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
working-directory: dandischema | ||
# vim:set sts=2: |