Skip to content

Commit

Permalink
Update workflow actions, fix triggering release 3x.
Browse files Browse the repository at this point in the history
Signed-off-by: Caroline Russell <[email protected]>
  • Loading branch information
cerrussell committed Mar 2, 2024
1 parent ce46fa7 commit 254a05b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python -m pip install --upgrade pip
Expand Down
23 changes: 10 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Publish release
name: Publish to PyPI

on:
release:
push:
branches:
- master
workflow_dispatch:

concurrency:
Expand All @@ -22,29 +24,24 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine build
python3 -m pip install setuptools build
- name: Build
run: |
python3 -m build
- name: Make sure version in atom_tools.__init__.py has been updated
if: startsWith(github.ref, 'refs/tags/')
run: |
version=$(python3 -c 'from atom_tools.__init__ import __version__; print(f"refs/tags/v{__version__}")')
if $version != "${{ github.ref }}"; then
echo "Version in atom_tools.__init__.py has not been updated. $version != ${{ github.ref }}"
exit 1
fi
- name: Create Release
id: create_release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
python3 -m build
- name: Publish package distributions to PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Make sure versions are synced if PR or ref is tag
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ available commands.
Individual command options can be accessed with `atom help ` and the command
name (e.g. `atom help convert`).
```
Atom Tools (version 0.1.0)
Atom Tools (version 0.3.0)
Usage:
command [options] [arguments]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "atom-tools"
version = "0.2.1"
version = "0.3.0"
description = "Collection of tools for use with AppThreat/atom."
authors = [
{ name = "Caroline Russell", email = "[email protected]" },
Expand Down

0 comments on commit 254a05b

Please sign in to comment.