forked from nelsonenzo/tmux-appimage
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (50 loc) · 1.94 KB
/
check_tmux_version.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
name: Build and release when new tmux version is out.
on:
schedule:
- cron: '0 10 * * *'
workflow_dispatch:
jobs:
get-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: master
- name: Fetch release version
run: |
latest_version=$(curl -sL https://api.github.com/repos/tmux/tmux/releases/latest | jq -r ".tag_name")
if [[ $latest_version != "null" ]]
then
echo "$latest_version" > release-versions/tmux-latest.txt
fi
- name: Check for modified files
id: git-check
run: echo modified="$([ -z "`git status --porcelain`" ] && echo "false" || echo "true")" >> $GITHUB_OUTPUT
- name: Commit latest release version
if: steps.git-check.outputs.modified == 'true'
run: |
git config --global user.name 'Kiyoon Kim'
git config --global user.email 'kiyoon@users.noreply.github.com'
git commit -am "New tmux release version"
git push
- name: Build the Docker image
if: steps.git-check.outputs.modified == 'true'
id: build
working-directory: .
run: |
TMUX_RELEASE_TAG=$(cat release-versions/tmux-latest.txt)
echo "TMUX_RELEASE_TAG=$TMUX_RELEASE_TAG" >> $GITHUB_OUTPUT
docker build . -t tmux --build-arg TMUX_RELEASE_TAG=$TMUX_RELEASE_TAG
docker create -ti --name tmuxcontainer tmux bash
docker cp tmuxcontainer:/opt/build/tmux.appimage .
- name: Create Release
if: steps.git-check.outputs.modified == 'true'
uses: ncipollo/release-action@v1
with:
allowUpdates: True
tag: ${{ steps.build.outputs.TMUX_RELEASE_TAG }}
name: tmux ${{ steps.build.outputs.TMUX_RELEASE_TAG }}
prerelease: False
artifacts: "tmux.appimage"
token: ${{ secrets.GITHUB_TOKEN }}