kstr0k build AppImage #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
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 }} | |
kstr0k_tag: ${{ steps.output-tags.outputs.kstr0k_tag }} | |
steps: | |
- name: Get latest tags | |
id: query-tags | |
env: | |
MYREPO: ${{ github.event.repository.name }} | |
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 } } | |
} | |
} | |
} | |
run: | | |
json=$(gh api graphql -F myowner="$MYOWNER" -F myrepo="$MYREPO" \ | |
-f query="$GQL_Q1") | |
tee -a "$GITHUB_OUTPUT" <<EOGHO | |
json=$json | |
EOGHO | |
- name: Output tags | |
id: output-tags | |
run: | | |
vim_tag=${{ fromJSON(steps.query-tags.outputs.json).data.vim.refs.edges[0].node.name }} | |
vim_forced_tag=${{ github.event.inputs.vim_tag }} | |
if [ -n "${vim_forced_tag}" ]; then | |
vim_tag=$vim_forced_tag | |
fi | |
IFS= read -r prev_vim_tag <<'EOVAL' | |
${{ fromJSON(steps.query-tags.outputs.json).data.appimage.releases.nodes[0].name }} | |
EOVAL | |
prev_vim_tag=$(printf '%s' "$prev_vim_tag" | sed -ne 's@.* \(v[1-9][0-9.]\+\).*@\1@p') | |
tee -a "$GITHUB_OUTPUT" <<EOGHO | |
prev_vim_tag=${prev_vim_tag} | |
vim_tag=${vim_tag} | |
kstr0k_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 | |
TERM: xterm | |
DISPLAY: ':99' | |
DEBIAN_FRONTEND: noninteractive | |
VIM_REF: ${{ needs.get-tags-job.outputs.prev_vim_tag }} | |
vim_tag: ${{ needs.get-tags-job.outputs.vim_tag }} | |
kstr0k_tag: ${{ needs.get-tags-job.outputs.kstr0k_tag }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install packages | |
run: sudo bash -e scripts/install-distro-build-deps.sh | |
- name: Update Vim | |
run: | | |
git submodule update --init | |
git submodule update --remote | |
git -C vim switch --detach "${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: Build Vim | |
run: bash -e 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: | | |
make -C vim/src/gvim 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: | | |
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}" | |
if git commit -m "Vim: ${vim_tag}" -m "${vim_summary}" -m "${workflow_url}" vim; then | |
echo 'Changes committed' | |
fi | |
git tag -f "${kstr0k_tag}" # release tag | |
git push --atomic -u origin "${GITHUB_REF_NAME}" "${kstr0k_tag}" | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: release.body | |
name: 'vim-appimage: ${{ needs.get-tags-job.outputs.kstr0k_tag }}' | |
tag_name: ${{ needs.get-tags-job.outputs.kstr0k_tag }} | |
files: | | |
*.AppImage | |
*.zsync |