-
Notifications
You must be signed in to change notification settings - Fork 20
157 lines (135 loc) · 4.52 KB
/
release.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
155
156
157
name: Release AppImage
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
check-updates-job:
runs-on: ubuntu-latest
outputs:
updated: ${{ steps.check-updates.outputs.updated }}
appimagetag: ${{ steps.check-updates.outputs.appimagetag }}
steps:
- name: Set up param
id: param
run: awk -F/ '{print"owner="$1"\nrepo="$2}' <<< "${{ github.repository }}" >> "$GITHUB_OUTPUT"
- name: Get latest tags
id: latest-tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ steps.param.outputs.owner }}
repo: ${{ steps.param.outputs.repo }}
query: |
query($owner:String!,$repo:String!) {
appimage: repository(owner:$owner, name:$repo) {
refs(refPrefix:"refs/tags/", last:1) {
edges {
node {
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,
"appimage_tag=" + .data.appimage.refs.edges[0].node.name
run: |
gh api graphql -F owner="$owner" -F repo="$repo" -f query="$query" --jq "$jq_extract" | \
tee -a "$GITHUB_ENV"
- name: Check updates
id: check-updates
run: |
printf >> "$GITHUB_OUTPUT" '%s\n' \
"appimagetag=${appimage_tag}" \
"updated=$([[ ${appimage_tag} != ${vim_tag} ]] && echo true)"
create-appimage-job:
runs-on: ubuntu-20.04
needs: check-updates-job
if: needs.check-updates-job.outputs.updated == 'true'
env:
CC: gcc
TERM: xterm
DISPLAY: ':99'
DEBIAN_FRONTEND: noninteractive
VIM_REF: ${{ needs.check-updates-job.outputs.appimagetag }}
steps:
- uses: actions/checkout@v4
- name: Install packages
run: |
sudo apt update && sudo apt install -y \
autoconf \
lcov \
gettext \
libcanberra-dev \
libperl-dev \
python-dev \
python3.8-dev \
liblua5.3-dev \
lua5.3 \
ruby-dev \
tcl-dev \
cscope \
libgtk-3-dev \
desktop-file-utils \
libtool-bin \
at-spi2-core \
libsodium-dev \
gcc-10
- name: Update Vim
run: |
git submodule update --init
git submodule update --remote
- name: Set up system
run: |
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
sudo bash vim/ci/setup-xvfb.sh
- name: Build Vim
run: bash scripts/build_vim.sh
- name: Vim Version
run: |
vim/src/vim/vim --version
vim/src/gvim/vim --version
- name: Test Vim
timeout-minutes: 20
run: |
(
cd vim/src/gvim
make test
)
# dump failed screen tests
bash scripts/dump_failed_screentests.sh
- name: Create GVim AppImage
run: bash -e scripts/appimage.sh GVim
- name: Create Vim AppImage
run: bash -e scripts/appimage.sh Vim
- name: Commit and push
id: commit
run: |
tag_name=$(git -C vim describe --tags --abbrev=0)
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
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: ${tag_name}" -m "${vim_summary}" -m "${workflow_url}" vim
git tag -f "${tag_name}" -m "Vim: ${tag_name}"
git push --follow-tags -u origin "${GITHUB_REF_NAME}"
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.commit.outputs.tag_name }}
run: |
gh release create "$tag_name" \
*.AppImage *.zsync \
-F release.body -t "Vim: $tag_name"