Skip to content

Commit

Permalink
move release scripts to subfolder (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh authored Jan 10, 2025
1 parent 05ab673 commit 9818232
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
10 changes: 2 additions & 8 deletions .github/RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,12 @@
3. Run the release script:

```bash
./src/scripts/release.sh
./src/scripts/release/release.sh
```

This will commit the changes to the CHANGELOG and `version.py` files and then create a new tag in git
which will trigger a workflow on GitHub Actions that handles the rest.

## Fixing a failed release

If for some reason the GitHub Actions release workflow failed with an error that needs to be fixed, you'll have to delete both the tag and corresponding release from GitHub. After you've pushed a fix, delete the tag from your local clone with

```bash
git tag -l | xargs git tag -d && git fetch -t
```

Then repeat the steps above.
If for some reason the GitHub Actions release workflow failed with an error that needs to be fixed, you'll have to delete the tag on GitHub. Once you've pushed a fix you can simply repeat the steps above.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ jobs:
- name: Generate release notes
run: |
. .venv/bin/activate
python src/scripts/release_notes.py > ${{ github.workspace }}-RELEASE_NOTES.md
python src/scripts/release/release_notes.py > ${{ github.workspace }}-RELEASE_NOTES.md
- name: Publish package to PyPI
run: |
Expand All @@ -260,4 +260,4 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
./scripts/add_pr_comments_on_release.sh
./src/scripts/release/add_pr_comments_on_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

repo_url=https://github.com/allenai/OLMo-core

tags=$(git tag -l --sort=-version:refname 'v*' | head -n 2)
current_tag=$(echo "$tags" | head -n 1)
last_tag=$(echo "$tags" | tail -n 1)
Expand Down
File renamed without changes.
9 changes: 6 additions & 3 deletions src/scripts/release.sh → src/scripts/release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

set -e

TAG=$(python -c 'from olmo_core.version import VERSION; print("v" + VERSION)')
# Make sure clone is up-to-date with remote.
git pull > /dev/null
git tag -l | xargs git tag -d > /dev/null
git fetch -t > /dev/null

git pull
TAG=$(python -c 'from olmo_core.version import VERSION; print("v" + VERSION)')

# Make sure tag/release doesn't already exist.
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://github.com/allenai/OLMo-core/releases/tag/${TAG}")
Expand All @@ -13,7 +16,7 @@ if [[ $STATUS_CODE == "200" ]]; then
exit 1
fi

python src/scripts/prepare_changelog.py
python src/scripts/release/prepare_changelog.py

read -rp "Creating new release for $TAG. Do you want to continue? [Y/n] " prompt

Expand Down
File renamed without changes.

0 comments on commit 9818232

Please sign in to comment.