-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (63 loc) · 1.7 KB
/
Copy pathmakefile.yml
File metadata and controls
78 lines (63 loc) · 1.7 KB
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
name: Makefile CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
container:
image: kcov/kcov:latest
steps:
- name: Install dependencies
run: |
apt update && apt upgrade -y
apt install -y make git shellcheck xmlstarlet
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: luizm/action-sh-checker@master
with:
sh_checker_exclude: "test/bats test/test_helper"
- name: Build & Test
run: make all
- uses: actions/upload-artifact@v5
with:
name: git-bash-ed
path: git-bash-ed.tar.gz
release:
needs: build
runs-on: ubuntu-22.04
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v5
with:
name: git-bash-ed
- name: Read version
id: ver
run: |
VER=$(grep 'PACKAGE: git-bash-ed version' src/datetime.sh \
| grep -oP '\d+\.\d+\.\d+')
echo "version=${VER}" >> "$GITHUB_OUTPUT"
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
VER="v${{ steps.ver.outputs.version }}"
SHORT="${{ github.sha }}"
SHORT="${SHORT:0:7}"
if gh release view "${VER}" >/dev/null 2>&1; then
TAG="${VER}-${SHORT}"
else
TAG="${VER}"
fi
gh release create "${TAG}" git-bash-ed.tar.gz \
--title "git-bash-ed ${TAG}" \
--notes "Automated release from commit ${{ github.sha }}."