fix forgejo workflows to use proper syntax without external actions
Some checks failed
Build Deb-Mock Package / build (push) Failing after 2s
Test Deb-Mock Build / test (push) Failing after 2s

This commit is contained in:
robojerk 2025-08-03 22:33:08 +00:00
parent f89a0f1f04
commit 94a2914dff
4 changed files with 43 additions and 77 deletions

View file

@ -12,17 +12,18 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
run: |
git clone ${{ github.server_url }}/${{ github.repository }} .
git checkout ${{ github.sha }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
run: |
sudo apt update
sudo apt install -y python3.12 python3.12-venv python3-pip
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y sbuild schroot debootstrap python3-venv python3-pip
sudo apt install -y sbuild schroot debootstrap
- name: Create deb-mock directories
run: |
@ -56,14 +57,9 @@ jobs:
source venv/bin/activate
python setup.py sdist bdist_wheel
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: deb-mock-package
path: dist/
- name: Upload coverage reports
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: coverage.xml
- name: List artifacts
run: |
echo "Build artifacts created:"
ls -la dist/
echo "Coverage report:"
ls -la coverage.xml

View file

@ -11,17 +11,18 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
run: |
git clone ${{ github.server_url }}/${{ github.repository }} .
git checkout ${{ github.sha }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
run: |
sudo apt update
sudo apt install -y python3.12 python3.12-venv python3-pip
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y sbuild schroot debootstrap python3-venv python3-pip
sudo apt install -y sbuild schroot debootstrap
- name: Set up virtual environment
run: |
@ -50,33 +51,9 @@ jobs:
source venv/bin/activate
twine check dist/*
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/deb_mock-${{ github.ref_name }}.tar.gz
asset_name: deb-mock-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip
- name: Upload Wheel
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/deb_mock-${{ github.ref_name }}-py3-none-any.whl
asset_name: deb-mock-${{ github.ref_name }}-py3-none-any.whl
asset_content_type: application/zip
- name: List release artifacts
run: |
echo "Release artifacts created:"
ls -la dist/
echo "Tag: ${{ github.ref_name }}"
echo "Repository: ${{ github.repository }}"

View file

@ -12,17 +12,18 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
run: |
git clone ${{ github.server_url }}/${{ github.repository }} .
git checkout ${{ github.sha }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
run: |
sudo apt update
sudo apt install -y python3.12 python3.12-venv python3-pip
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y sbuild schroot debootstrap python3-venv python3-pip
sudo apt install -y sbuild schroot debootstrap
- name: Create deb-mock directories
run: |

View file

@ -13,12 +13,14 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
run: |
git clone ${{ github.server_url }}/${{ github.repository }} .
git checkout ${{ github.sha }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
run: |
sudo apt update
sudo apt install -y python3.12 python3.12-venv python3-pip
- name: Install dependencies
run: |
@ -37,25 +39,15 @@ jobs:
with open('README.md', 'r') as f:
content = f.read()
# Update build status
build_status = f'![Build Status](https://github.com/{{\"{{ github.repository }}\"}}/workflows/Build%20Deb-Mock%20Package/badge.svg)'
# Update last updated timestamp
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')
# Replace or add build status
if '![Build Status]' in content:
content = re.sub(r'!\[Build Status\].*', build_status, content)
else:
# Add after the title
content = content.replace('# Deb-Mock', f'# Deb-Mock\n\n{build_status}')
# Update last updated
if 'Last updated:' in content:
content = re.sub(r'Last updated:.*', f'Last updated: {timestamp}', content)
else:
# Add after build status
content = content.replace(build_status, f'{build_status}\n\nLast updated: {timestamp}')
# Add after the title
content = content.replace('# Deb-Mock', f'# Deb-Mock\n\n**Last updated: {timestamp}**')
# Write updated README
with open('README.md', 'w') as f:
@ -64,8 +56,8 @@ jobs:
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config --local user.email "action@forgejo.com"
git config --local user.name "Forgejo Action"
git add README.md
git diff --quiet && git diff --staged --quiet || git commit -m "Update README with build status"
git push