ci: add CI and release workflows for hackathon repo
This commit is contained in:
commit
1c87371574
27
.gitea/workflows/ci.yml
Normal file
27
.gitea/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with: { python-version: "3.11" }
|
||||
- run: pip install -r requirements.txt
|
||||
- run: python3 -m pytest tests/ -q
|
||||
|
||||
pages-check:
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check Pages config
|
||||
run: |
|
||||
echo "Pages enabled: ${{ github.event.repository.has_pages }}"
|
||||
35
.gitea/workflows/release.yml
Normal file
35
.gitea/workflows/release.yml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
name: Release Candidate
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
tag:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with: { fetch-depth: 0 }
|
||||
- name: Auto-tag RC
|
||||
run: |
|
||||
set -e
|
||||
TAG="rc-${{ github.run_number }}"
|
||||
git tag "$TAG" || true
|
||||
git push origin "$TAG" || true
|
||||
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
||||
|
||||
draft:
|
||||
runs-on: ubuntu-latest
|
||||
needs: tag
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with: { fetch-depth: 0 }
|
||||
- name: Draft release
|
||||
run: |
|
||||
set -e
|
||||
TAG="${{ needs.tag.outputs.tag }}"
|
||||
gh release create "$TAG" --draft --title "RC $TAG" --notes "Automated release candidate." || true
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Loading…
Reference in New Issue
Block a user