Skip to content

Commit

Permalink
Merge pull request #877 from afuetterer/ci-fix
Browse files Browse the repository at this point in the history
ci: run build-wheel job on main and prs
  • Loading branch information
jochenklar authored Dec 9, 2023
2 parents 1553c12 + 0ba663c commit 1dd972e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,22 @@ jobs:
name: Build python wheel
needs: test
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Get short commit SHA
id: short-sha
run: echo "sha=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})" >> $GITHUB_OUTPUT
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
SHA="${{ github.event.pull_request.head.sha }}"
else
SHA="${{ github.sha }}"
fi
echo "SHA=$(git rev-parse --short $SHA)" >> $GITHUB_ENV
- name: Get current version (MAJOR.MINOR.PATCH)
id: current-version
run: echo "current_version=$(grep -Po '(?<=__version__ = ")[\d\w.]+(?=")' rdmo/__init__.py)" >> $GITHUB_OUTPUT
- name: Generate new version (current version + SHA)
id: new-version
run: echo "new_version=${{ steps.current-version.outputs.current_version }}+${{ steps.short-sha.outputs.sha }}" >> $GITHUB_OUTPUT
run: echo "new_version=${{ steps.current-version.outputs.current_version }}+$SHA" >> $GITHUB_OUTPUT
- name: Update version in rdmo/__init__.py
run: |
sed -i "s/__version__ = .*/__version__ = \"${{ steps.new-version.outputs.new_version }}\"/" rdmo/__init__.py
Expand Down Expand Up @@ -218,7 +222,7 @@ jobs:
with:
node-version: 18
cache: npm
- run: npm install --dev
- run: npm install --include=dev
- name: Write info to step summary
run: |
{
Expand Down Expand Up @@ -251,6 +255,7 @@ jobs:
- lint
- test
- coveralls
- build-wheel
- dev-setup
- dependencies
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 1dd972e

Please sign in to comment.