-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (138 loc) · 3.96 KB
/
build-vim.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
158
159
160
161
name: Build Vim
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
arch: [x86, x64]
include:
- arch: x86
varch: i686
msystem: MINGW32
- arch: x64
varch: x86_64
msystem: MINGW64
steps:
- name: Initalize
shell: bash
run: |
git config --global core.autocrlf input
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-${{ matrix.varch }}-toolchain base-devel
msystem: ${{ matrix.msystem }}
path-type: inherit
- name: Update Vim
id: update
shell: msys2 {0}
run: |
./update-version.sh
if git diff --quiet HEAD PKGBUILD; then
echo "skip=yes" >> $GITHUB_OUTPUT
else
echo "skip=no" >> $GITHUB_OUTPUT
fi
- name: Build
if: steps.update.outputs.skip == 'no'
shell: msys2 {0}
run: |
makepkg -s --noconfirm
ls -l
- name: Upload Artifact
if: steps.update.outputs.skip == 'no'
uses: actions/upload-artifact@v4
with:
name: gvim-transparency-${{ matrix.varch }}
path: ./mingw-*.pkg.tar.zst
release:
runs-on: windows-latest
needs: [build]
strategy:
matrix:
arch: [x64]
include:
- arch: x64
varch: x86_64
msystem: MINGW64
steps:
- name: Initalize
shell: bash
run: |
git config --global core.autocrlf input
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-${{ matrix.varch }}-toolchain base-devel
msystem: ${{ matrix.msystem }}
path-type: inherit
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.x
- name: Update Vim
id: update
shell: msys2 {0}
run: |
./update-version.sh
if git diff --quiet HEAD PKGBUILD; then
echo "skip=yes" >> $GITHUB_OUTPUT
else
echo "skip=no" >> $GITHUB_OUTPUT
fi
- name: Commit/Push git
id: commit
if: steps.update.outputs.skip == 'no'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: msys2 {0}
run: |
git config --local user.name "mingw-gvim-transparency CI"
git config --local user.email "[email protected]"
git remote set-url origin https://raa0121:${GITHUB_TOKEN}@github.com/raa0121/mingw-gvim-transparency.git
git add PKGBUILD
pkgver=$(grep pkgver= PKGBUILD | sed -e 's/pkgver=//')
echo "version=$pkgver" >> $GITHUB_OUTPUT
git commit -m "v${pkgver}-1"
git push origin master
git tag ${pkgver}-1
git push origin ${pkgver}-1
- name: Download Artifact (x86_64)
if: steps.update.outputs.skip == 'no'
uses: actions/download-artifact@v4
with:
name: gvim-transparency-x86_64
path: pkg
- name: Download Artifact (i686)
if: steps.update.outputs.skip == 'no'
uses: actions/download-artifact@v4
with:
name: gvim-transparency-i686
path: pkg
- name: Create repo.db
if: steps.update.outputs.skip == 'no'
shell: msys2 {0}
run: |
repo-add ./pkg/mingw-raa0121.db.tar.gz ./pkg/mingw-w64-*gvim-transparency*.tar.*
- name: Create Release
if: steps.update.outputs.skip == 'no'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/create-release@master
with:
tag_name: ${{ steps.commit.outputs.version }}-1
release_name: ${{ steps.commit.outputs.version }}-1
- name: Upload
if: steps.update.outputs.skip == 'no'
run: go run github.com/tcnksm/ghr@latest "${{ steps.commit.outputs.version }}-1" pkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}