Browse Source

improve gh actions, issue templates (#1700)

pull/1702/head
Bernd Storath 5 months ago
committed by GitHub
parent
commit
bfe572ba5f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      .github/ISSUE_TEMPLATE/01-bug-report.yml
  2. 3
      .github/ISSUE_TEMPLATE/02-feature-request.yml
  3. 2
      .github/ISSUE_TEMPLATE/config.yml
  4. 8
      .github/workflows/codeql.yml
  5. 38
      .github/workflows/deploy-development.yml
  6. 34
      .github/workflows/deploy-nightly.yml
  7. 8
      .github/workflows/deploy-pr.yml
  8. 42
      .github/workflows/deploy.yml
  9. 62
      .github/workflows/lint.yml
  10. 4
      docs/requirements.txt

7
.github/ISSUE_TEMPLATE/01-bug-report.yml

@ -4,6 +4,7 @@ description: Create a report to help us improve
title: "[Bug]: " title: "[Bug]: "
labels: labels:
- "type: bug" - "type: bug"
type: Bug
body: body:
- type: markdown - type: markdown
@ -11,7 +12,7 @@ body:
value: | value: |
**Thanks :heart: for taking the time to fill out this bug report!** **Thanks :heart: for taking the time to fill out this bug report!**
We kindly ask that you search to see if an issue [already exists](https://github.com/wg-easy/wg-easy/issues?q=is%3Aissue+sort%3Acreated-desc+) for the bug you encountered. We kindly ask that you search to see if an issue [already exists](https://github.com/wg-easy/wg-easy/issues?q=is%3Aissue+sort%3Acreated-desc+) for the bug you encountered.
- type: textarea - type: textarea
id: what-happened id: what-happened
attributes: attributes:
@ -20,7 +21,7 @@ body:
value: "A bug happened!" value: "A bug happened!"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: what-should-happen id: what-should-happen
attributes: attributes:
@ -29,7 +30,7 @@ body:
value: "Work just fine!" value: "Work just fine!"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: logs id: logs
attributes: attributes:

3
.github/ISSUE_TEMPLATE/02-feature-request.yml

@ -2,8 +2,7 @@
name: 🛠️ Feature Request name: 🛠️ Feature Request
description: Suggest an idea to help us improve description: Suggest an idea to help us improve
title: "[Feat]: " title: "[Feat]: "
labels: type: Feature
- "type: feature request"
body: body:
- type: markdown - type: markdown

2
.github/ISSUE_TEMPLATE/config.yml

@ -2,4 +2,4 @@ contact_links:
- name: Get Help - name: Get Help
url: https://github.com/wg-easy/wg-easy/discussions/new?category=q-a url: https://github.com/wg-easy/wg-easy/discussions/new?category=q-a
about: If you can't get something to work the way you expect, open a question in the discussions. about: If you can't get something to work the way you expect, open a question in the discussions.
blank_issues_enabled: false blank_issues_enabled: false

8
.github/workflows/codeql.yml

@ -1,10 +1,12 @@
name: "CodeQL" name: CodeQL
on: on:
push: push:
branches: ["master"] branches:
- master
pull_request: pull_request:
branches: ["master"] branches:
- master
schedule: schedule:
- cron: "15 0 * * *" - cron: "15 0 * * *"

38
.github/workflows/deploy-development.yml

@ -1,11 +1,11 @@
name: Build & Publish Development name: Development
on: on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
deploy: docker:
name: Build & Deploy name: Build & Deploy Docker
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy' if: github.repository_owner == 'wg-easy'
permissions: permissions:
@ -32,7 +32,37 @@ jobs:
with: with:
context: . context: .
push: true push: true
platforms: linux/amd64,linux/arm64/v8 platforms: linux/amd64,linux/arm64
tags: ghcr.io/wg-easy/wg-easy:development tags: ghcr.io/wg-easy/wg-easy:development
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=min cache-to: type=gha,mode=min
docs:
name: Build & Deploy Docs
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
contents: write
needs: docker
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11.9
cache: "pip"
- name: Install Dependencies
run: |
pip install -r docs/requirements.txt
- name: Setup Git User
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build Docs Website
run: |
cd docs
git fetch origin gh-pages --depth=1 || true
mike deploy --push --update-aliases development

34
.github/workflows/deploy-nightly.yml

@ -1,4 +1,4 @@
name: Build & Publish Nightly name: Nightly
on: on:
workflow_dispatch: workflow_dispatch:
@ -6,13 +6,13 @@ on:
- cron: "0 0 * * *" - cron: "0 0 * * *"
jobs: jobs:
deploy: docker:
name: Build & Deploy name: Build & Deploy Docker
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy' if: github.repository_owner == 'wg-easy'
permissions: permissions:
packages: write packages: write
contents: write contents: read
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -36,25 +36,37 @@ jobs:
with: with:
context: . context: .
push: true push: true
platforms: linux/amd64,linux/arm64/v8 platforms: linux/amd64,linux/arm64
tags: ghcr.io/wg-easy/wg-easy:nightly tags: ghcr.io/wg-easy/wg-easy:nightly
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=min cache-to: type=gha,mode=min
docs:
name: Build & Deploy Docs
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
permissions:
contents: write
needs: docker
steps:
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: 3.11.9 python-version: 3.11.9
cache: "pip"
- name: Install Dependencies - name: Install Dependencies
run: | run: |
pip install mkdocs-material pip install -r docs/requirements.txt
pip install pillow cairosvg mike
- name: Setup Docs Deploy - name: Setup Git User
run: | run: |
git config --global user.name 'Docs Deploy Bot' git config --global user.name 'github-actions[bot]'
git config --global user.email 'docs.deploy@users.noreply.github.com' git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build Docs Website - name: Build Docs Website
run: | run: |
cd docs cd docs
git fetch origin gh-pages --depth=1 git fetch origin gh-pages --depth=1 || true
mike deploy --push --update-aliases nightly mike deploy --push --update-aliases nightly

8
.github/workflows/deploy-pr.yml

@ -1,4 +1,4 @@
name: Build Pull Request name: Pull Request
on: on:
workflow_dispatch: workflow_dispatch:
@ -9,8 +9,8 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
deploy: docker:
name: Build & Deploy name: Build Docker
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy' if: github.repository_owner == 'wg-easy'
permissions: permissions:
@ -37,7 +37,7 @@ jobs:
with: with:
context: . context: .
push: false push: false
platforms: linux/amd64,linux/arm64/v8 platforms: linux/amd64,linux/arm64
tags: ghcr.io/wg-easy/wg-easy:pr tags: ghcr.io/wg-easy/wg-easy:pr
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=min cache-to: type=gha,mode=min

42
.github/workflows/deploy.yml

@ -1,4 +1,4 @@
name: Build & Publish Latest name: Production
on: on:
workflow_dispatch: workflow_dispatch:
@ -7,15 +7,15 @@ on:
- "v*" - "v*"
jobs: jobs:
deploy: docker:
name: Build & Deploy name: Build & Deploy Docker
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: | if: |
github.repository_owner == 'wg-easy' && github.repository_owner == 'wg-easy' &&
startsWith(github.ref, 'refs/tags/v') startsWith(github.ref, 'refs/tags/v')
permissions: permissions:
packages: write packages: write
contents: write contents: read
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -48,31 +48,45 @@ jobs:
with: with:
context: . context: .
push: true push: true
platforms: linux/amd64,linux/arm64/v8 platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=min cache-to: type=gha,mode=min
docs:
name: Build & Deploy Docs
runs-on: ubuntu-latest
if: |
github.repository_owner == 'wg-easy' &&
startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
needs: docker
steps:
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: 3.11.9 python-version: 3.11.9
cache: "pip"
- name: Install Dependencies - name: Install Dependencies
run: | run: |
pip install mkdocs-material pip install -r docs/requirements.txt
pip install pillow cairosvg mike
- name: Setup Docs Deploy - name: Setup Git User
run: | run: |
git config --global user.name 'Docs Deploy Bot' git config --global user.name 'github-actions[bot]'
git config --global user.email 'docs.deploy@users.noreply.github.com' git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Build Docs Website - name: Build Docs Website
run: | run: |
cd docs cd docs
git fetch origin gh-pages --depth=1 git fetch origin gh-pages --depth=1 || true
mike deploy --push --update-aliases ${{ github.ref_name }} latest
# latest will point to old docs if old tag is pushed
# Extract version numbers (remove 'v' prefix) # Extract version numbers
DOCS_VERSION=${GITHUB_REF#refs/tags/} # e.g. v1.2.3 or v1.2.3-beta DOCS_VERSION=${GITHUB_REF#refs/tags/} # e.g. v1.2.3 or v1.2.3-beta
MINOR_VERSION=$(echo $DOCS_VERSION | cut -d. -f1,2) # e.g. v1.2 MINOR_VERSION=$(echo $DOCS_VERSION | cut -d. -f1,2) # e.g. v1.2
@ -81,6 +95,6 @@ jobs:
echo "Stable release detected: $DOCS_VERSION" echo "Stable release detected: $DOCS_VERSION"
mike deploy --push --update-aliases $MINOR_VERSION latest mike deploy --push --update-aliases $MINOR_VERSION latest
else else
echo "Prerelease detected: $DOCS_VERSION" echo "Pre-release detected: $DOCS_VERSION"
mike deploy --push --update-aliases Pre-release mike deploy --push --update-aliases Pre-release
fi fi

62
.github/workflows/lint.yml

@ -4,7 +4,6 @@ on:
push: push:
branches: branches:
- master - master
- production
pull_request: pull_request:
jobs: jobs:
@ -12,58 +11,13 @@ jobs:
name: Lint name: Lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy' if: github.repository_owner == 'wg-easy'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "lts/*"
check-latest: true
cache: "pnpm"
- name: pnpm lint
run: |
cd src
pnpm install
pnpm lint
typecheck:
name: Typecheck
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4 strategy:
name: Install pnpm fail-fast: false
with: max-parallel: 3
run_install: false matrix:
command: ["lint", "typecheck", "format:check"]
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
check-latest: true
cache: "pnpm"
- name: pnpm typecheck
run: |
cd src
pnpm install
pnpm typecheck
formatcheck:
name: Check format
runs-on: ubuntu-latest
if: github.repository_owner == 'wg-easy'
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -76,12 +30,12 @@ jobs:
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: "20" node-version: "lts/*"
check-latest: true check-latest: true
cache: "pnpm" cache: "pnpm"
- name: pnpm format:check - name: pnpm ${{ matrix.command }}
run: | run: |
cd src cd src
pnpm install pnpm install
pnpm format:check pnpm ${{ matrix.command }}

4
docs/requirements.txt

@ -0,0 +1,4 @@
mkdocs-material
pillow
cairosvg
mike
Loading…
Cancel
Save