-
Notifications
You must be signed in to change notification settings - Fork 44
80 lines (68 loc) · 2.15 KB
/
lint_and_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
name: Lint Code Base
on:
push:
pull_request:
branches: [main]
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Check alphabetical order in file
run: |
cp README.md README.prev.md
make
diff README.prev.md README.md
env:
LANG: de_DE.UTF-8
LC_ALL: de_DE.UTF-8
- name: Lint Code Base
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_NATURAL_LANGUAGE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.x"
- name: Install fortune
if: github.ref == 'refs/heads/main'
run: sudo apt-get install fortune
- name: Run make gen-fortune
if: github.ref == 'refs/heads/main'
run: make gen-fortune
- name: Get Date
if: github.ref == 'refs/heads/main'
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Get Short SHA
if: github.ref == 'refs/heads/main'
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
# Create release upon push on main
- name: Create tag
if: github.ref == 'refs/heads/main'
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: v${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}
- name: Create Release
if: github.ref == 'refs/heads/main'
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}
name: v${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}
draft: false
prerelease: false
files: |
output/flachwitze
output/flachwitze.dat