forked from vim/vim-appimage
-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (130 loc) · 4.8 KB
/
kstr0k-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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: kstr0k build AppImage
on:
# schedule:
# - cron: '0 0 * * *'
workflow_dispatch:
inputs:
vim_tag:
description: 'Vim tag to build (empty=latest)'
default: ''
env:
MYOWNER: ${{ github.repository_owner }}
MYREPO: ${{ github.event.repository.name }}
jobs:
get-tags-job:
runs-on: ubuntu-latest
outputs:
updated: ${{ steps.output-tags.outputs.updated }}
prev_vim_tag: ${{ steps.output-tags.outputs.prev_vim_tag }}
vim_tag: ${{ steps.output-tags.outputs.vim_tag }}
release_tag: ${{ steps.output-tags.outputs.release_tag }}
steps:
- name: Get latest tags
id: query-tags
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GQL_Q1: |
query($myowner: String!, $myrepo: String!) {
appimage: repository(owner: $myowner, name: $myrepo) {
releases(first: 1, orderBy: { field: CREATED_AT, direction: DESC }) {
nodes { name }
}
}
vim: repository(owner: "vim", name: "vim") {
refs(refPrefix: "refs/tags/", last: 1) {
edges { node { name } }
}
}
}
jq_extract: >-
"vim_tag=" + .data.vim.refs.edges[0].node.name,
"prev_release_name<<_EOVAL_\n" + .data.appimage.releases.nodes[0].name + "\n_EOVAL_"
run: |
gh api graphql -F myowner="$MYOWNER" -F myrepo="$MYREPO" \
-f query="$GQL_Q1" --jq "$jq_extract" | tee -a "$GITHUB_ENV"
- name: Output tags
id: output-tags
run: |
vim_forced_tag=${{ github.event.inputs.vim_tag }}
if [ -n "${vim_forced_tag}" ]; then
vim_tag=$vim_forced_tag
fi
prev_vim_tag=$(printf '%s' "$prev_release_name" | sed -ne 's@.* \(v[1-9][0-9.]\+\).*@\1@p;q')
tee -a "$GITHUB_OUTPUT" <<EOGHO
prev_vim_tag=${prev_vim_tag}
vim_tag=${vim_tag}
release_tag=${vim_tag}-kstr0k-appimage
updated=$([ "${prev_vim_tag}" != "${vim_tag}" ] && echo true)
EOGHO
create-appimage-job:
runs-on: ubuntu-22.04
needs: get-tags-job
if: needs.get-tags-job.outputs.updated == 'true'
env:
CC: gcc
vim_tag: '${{ needs.get-tags-job.outputs.vim_tag }}'
prev_vim_tag: '${{ needs.get-tags-job.outputs.prev_vim_tag }}'
release_tag: '${{ needs.get-tags-job.outputs.release_tag }}'
steps:
- uses: actions/checkout@v4
- name: Check release tag available
run: |
! git rev-parse "${release_tag}^{tag}"
- name: Install packages
run: |
sudo scripts/install-distro-build-deps.sh
- name: Update Vim
run: |
scripts/update-submodules.sh
git -C vim log --pretty=oneline --abbrev-commit "${prev_vim_tag}^..@"
- name: Set up system
run: |
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
sudo bash vim/ci/setup-xvfb.sh
- name: Download tools
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p tools; cd tools
../scripts/download-tools.sh
- name: Build Vim
run: |
scripts/build_vim.sh
- name: Vim Version
run: |
vim/src/vim/vim --version
vim/src/gvim/vim --version
- name: Test Vim
env:
TERM: xterm
DISPLAY: ':99'
timeout-minutes: 20
run: |
make -C vim/src/gvim test
- name: Dump failed screen tests
run: |
scripts/dump_failed_screentests.sh
- name: Create GVim and Vim AppImage
run: |
scripts/appimage.sh GVim Vim
- name: Commit and push
id: commit
run: |
vim_summary=$(git submodule summary vim)
workflow_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin "https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}"
git commit -m "Vim: ${vim_tag}" -m "${vim_summary}" -m "${workflow_url}" vim
git tag -f "${release_tag}" # release tag
git push --atomic -u origin "${GITHUB_REF_NAME}" "${release_tag}"
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release_tag: ${{ needs.get-tags-job.outputs.release_tag }}
run: |
gh release create "$release_tag" \
*-appimage/*.AppImage *-appimage/*.zsync \
-F release.body -t "vim-appimage: $release_tag"
#printf '%s' 'Latest release: '
#gh api 'repos/{owner}/{repo}/releases/latest' --jq '.html_url' || :