Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
afuetterer committed Dec 9, 2023
1 parent 4ed72bf commit 227c13a
Showing 1 changed file with 41 additions and 48 deletions.
89 changes: 41 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,63 +136,56 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Get short commit SHA
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
SHA="${{ github.event.pull_request.head.sha }}"
else
SHA="${{ github.sha }}"
fi
echo $SHA
echo "SHA=$(git rev-parse --short $SHA)" >> $GITHUB_ENV
- name: Use SHA variable
- 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 }}+$SHA" >> $GITHUB_OUTPUT
- name: Update version in rdmo/__init__.py
run: |
echo "The SHA is $SHA"
# - 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
# - name: Update version in rdmo/__init__.py
# run: |
# sed -i "s/__version__ = .*/__version__ = \"${{ steps.new-version.outputs.new_version }}\"/" rdmo/__init__.py
# - uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: npm
# - run: npm install
# - run: npm run build:prod
# - uses: actions/setup-python@v4
# with:
# python-version: '3.12'
# cache: pip
# - run: |
# python -m pip install --upgrade pip
# python -m pip install .[dev]
# - name: Build the wheel
# run: python -m build --wheel
# - name: Check metadata
# run: python -m twine check --strict dist/*
# - name: Install package from built wheel
# run: python -m pip install --force-reinstall dist/rdmo*.whl
# - name: Write info to step summary
# run: |
# echo -e "# ✓ Wheel successfully built (v${{ steps.new-version.outputs.new_version }})\n\n" >> $GITHUB_STEP_SUMMARY
# echo "\`\`\`console" >> $GITHUB_STEP_SUMMARY
# echo "$ python -m pip show rdmo" >> $GITHUB_STEP_SUMMARY
# python -m pip show rdmo >> $GITHUB_STEP_SUMMARY
# echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
# - name: Upload wheel as artifact
# uses: actions/upload-artifact@v3
# with:
# name: wheel
# path: dist/rdmo*.whl
# if-no-files-found: error
# retention-days: 30
sed -i "s/__version__ = .*/__version__ = \"${{ steps.new-version.outputs.new_version }}\"/" rdmo/__init__.py
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- run: npm install
- run: npm run build:prod
- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: pip
- run: |
python -m pip install --upgrade pip
python -m pip install .[dev]
- name: Build the wheel
run: python -m build --wheel
- name: Check metadata
run: python -m twine check --strict dist/*
- name: Install package from built wheel
run: python -m pip install --force-reinstall dist/rdmo*.whl
- name: Write info to step summary
run: |
echo -e "# ✓ Wheel successfully built (v${{ steps.new-version.outputs.new_version }})\n\n" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`console" >> $GITHUB_STEP_SUMMARY
echo "$ python -m pip show rdmo" >> $GITHUB_STEP_SUMMARY
python -m pip show rdmo >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
- name: Upload wheel as artifact
uses: actions/upload-artifact@v3
with:
name: wheel
path: dist/rdmo*.whl
if-no-files-found: error
retention-days: 30

# dev-setup:
# # Ref: structlog (MIT licensed) <https://github.com/hynek/structlog/blob/main/.github/workflows/ci.yml>
Expand Down

0 comments on commit 227c13a

Please sign in to comment.