Build Vim #1492
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: 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 }} |