Fixing release and test actions
Unit Testing / test (3.10) (push) Successful in 48s
Unit Testing / test (3.11) (push) Successful in 48s
Unit Testing / test (3.12) (push) Successful in 49s
Unit Testing / test (3.9) (push) Successful in 48s
Unit Testing / test (3.8) (push) Successful in 50s

Reviewed-on: #2
Co-authored-by: Artur Glavic <artur.glavic@psi.ch>
Co-committed-by: Artur Glavic <artur.glavic@psi.ch>
This commit was merged in pull request #2.
This commit is contained in:
2026-03-02 12:00:36 +01:00
committed by glavic_a
parent 29d406a290
commit 93baf06655
5 changed files with 100 additions and 76 deletions
+17
View File
@@ -0,0 +1,17 @@
name: Pull Request Merged
on:
pull_request:
types: [closed]
jobs:
autoupdate_minor:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -c "import eos; print(eos.__version__)"
+64 -58
View File
@@ -27,8 +27,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.12']
fail-fast: false
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
fail-fast: true
steps:
- name: Checkout LFS objects
@@ -46,8 +46,32 @@ jobs:
- name: Test with pytest
run: |
export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
python -m pytest tests
release:
if: ${{ (github.event_name != 'workflow_dispatch') || (contains(fromJson('["all_incl_release"]'), github.event.inputs.build-items)) }}
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- name: get latest version tag and release note
run: |
git fetch --depth=500
this_tag=$(python -c "import eos;print('v'+eos.__version__)")
prev_tag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
echo "Relese tag $this_tag with changes since $prev_tag"
echo "Changes:
" > git_changes.log
git log $prev_tag..HEAD --pretty=format:"* %s" >> git_changes.log
cat git_changes.log
echo "RELEASE_TAG=$this_tag" >> $GITHUB_ENV
- name: Create Release
uses: actions/gitea-release-action@v1
with:
name: "Amor-Eos ${{ env.RELEASE_TAG }}"
tag_name: "${{ env.RELEASE_TAG }}"
body_path: git_changes.log
build-ubuntu-latest:
needs: [test]
@@ -69,63 +93,45 @@ jobs:
- name: Build PyPI package
run: |
python3 -m build
# - name: Archive distribution
# uses: actions/upload-artifact@v3
# with:
# name: linux-dist
# path: |
# dist/*.tar.gz
- name: Upload to PyPI
run: |
twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} --skip-existing
this_tag=$(python -c "import eos;print('v'+eos.__version__)")
echo "RELEASE_TAG=$this_tag" >> $GITHUB_ENV
- name: Update Release
if: ${{ (github.event_name != 'workflow_dispatch') || (contains(fromJson('["all_incl_release"]'), github.event.inputs.build-items)) }}
uses: actions/gitea-release-action@v1
with:
name: "Amor-Eos ${{ env.RELEASE_TAG }}"
tag_name: "${{ env.RELEASE_TAG }}"
files: |-
dist/amor*.tar.gz
build-windows:
needs: [test]
runs-on: windows-latest
if: ${{ (github.event_name != 'workflow_dispatch') || (contains(fromJson('["all", "windows", "all_incl_release"]'), github.event.inputs.build-items)) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
C:\Miniconda\condabin\conda.bat env update --file conda_windows.yml --name base
C:\Miniconda\condabin\conda.bat init powershell
- name: Build with pyinstaller
run: |
pyinstaller windows_build.spec
cd dist\eos
Compress-Archive -Path .\* -Destination ..\..\eos.zip
- name: Archive distribution
uses: actions/upload-artifact@v3
with:
name: windows-dist
path: |
eos.zip
release:
if: ${{ (github.event_name != 'workflow_dispatch') || (contains(fromJson('["all_incl_release"]'), github.event.inputs.build-items)) }}
runs-on: ubuntu-latest
needs: [build-ubuntu-latest, build-windows]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/download-artifact@v3
with:
name: linux-dist
- uses: actions/download-artifact@v3
with:
name: windows-dist
- name: get latest version tag
run: echo "RELEASE_TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- uses: ncipollo/release-action@v1
with:
artifacts: "amor*.tar.gz,*.zip"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ env.RELEASE_TAG }}
# build-windows:
# needs: [test]
# runs-on: windows-latest
# if: ${{ (github.event_name != 'workflow_dispatch') || (contains(fromJson('["all", "windows", "all_incl_release"]'), github.event.inputs.build-items)) }}
#
# steps:
# - uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: 3.12
# - name: Install dependencies
# run: |
# C:\Miniconda\condabin\conda.bat env update --file conda_windows.yml --name base
# C:\Miniconda\condabin\conda.bat init powershell
# - name: Build with pyinstaller
# run: |
# pyinstaller windows_build.spec
# cd dist\eos
# Compress-Archive -Path .\* -Destination ..\..\eos.zip
# - name: Update Release
# if: ${{ (github.event_name != 'workflow_dispatch') || (contains(fromJson('["all_incl_release"]'), github.event.inputs.build-items)) }}
# uses: actions/gitea-release-action@v1
# with:
# name: "Amor-Eos ${{ env.RELEASE_TAG }}"
# tag_name: "${{ env.RELEASE_TAG }}"
# files: |-
# eos.zip
+2 -1
View File
@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
fail-fast: false
steps:
@@ -35,4 +35,5 @@ jobs:
- name: Test with pytest
run: |
export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
python -m pytest tests