-
Notifications
You must be signed in to change notification settings - Fork 14
103 lines (87 loc) · 3 KB
/
ci.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
name: CI
on:
push:
pull_request:
schedule:
- cron: '30 19 * * *'
jobs:
build-package:
strategy:
fail-fast: false
matrix:
include:
- MINGW_ARCH: "mingw32"
- MINGW_ARCH: "mingw64"
- MINGW_ARCH: "ucrt64"
runs-on: windows-latest
env:
MINGW_ARCH: ${{ matrix.MINGW_ARCH }}
APPVEYOR_SCHEDULED_BUILD: ${{ github.event.schedule }}
DEPLOY_REPO_NAME: oneclick/rubyinstaller2-packages
DEPLOY_TAG: ci.ri2
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
steps:
- name: configure git crlf
run: |
git config --system core.autocrlf false
git config --system core.eol lf
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
- run: bundle install
- name: Update MSYS2
shell: powershell
# See https://github.com/msys2/MSYS2-packages/issues/258
run: |
C:\msys64\usr\bin\rm -rf $env:MINGW_PREFIX/bin/libcrypto-3-x64.dll $env:MINGW_PREFIX/bin/libssl-3-x64.dll $env:MINGW_PREFIX/etc/ssl/openssl.cnf
C:\msys64\usr\bin\pacman --noconfirm --ask 20 --sync --refresh --refresh --sysupgrade --sysupgrade
Get-Process | Where-Object {$_.path -like 'C:\msys64*'} | Stop-Process
C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade
- name: Print version info
shell: cmd
run: |
ruby -v
ridk exec gcc -v
- name: Build packages
shell: cmd
env:
GPGPASSWD: ${{ secrets.GPGPASSWD }}
run: C:\msys64\usr\bin\bash --login -c "$(cygpath ${GITHUB_WORKSPACE})/ci-build.sh"
- name: Create lock ID
shell: cmd
run: ruby -e 'puts "DEPLOY_LOCK=#{rand}"' >>%GITHUB_ENV%
- name: Lock package repository
shell: cmd
run: rake upload:lock
- name: Download package database
shell: cmd
env:
GPGPASSWD: ${{ secrets.GPGPASSWD }}
run: |
ridk exec bash -c "source 'ci-library.sh'; deploy_enabled && cd artifacts && create_pacman_repository 'ci.ri2'"
- name: Backup pacman database as artifacts
uses: actions/upload-artifact@v3
with:
name: pacman-database
path: |
artifacts/*.db.tar.zst
artifacts/*.db.tar.zst.sig
artifacts/*.db
artifacts/*.db.sig
artifacts/*.files.tar.zst
artifacts/*.files.tar.zst.sig
artifacts/*.files
artifacts/*.files.sig
- name: Upload packages
shell: cmd
run: rake upload -- artifacts/*.pkg.tar.zst artifacts/*.pkg.tar.zst.sig artifacts/*.db.tar.zst artifacts/*.db.tar.zst.sig artifacts/*.db artifacts/*.db.sig artifacts/*.files.tar.zst artifacts/*.files.tar.zst.sig artifacts/*.files artifacts/*.files.sig
- name: Remove outdated packages from github releases
shell: cmd
run: rake upload:remove_old
- name: Unlock package repository
shell: cmd
if: ${{ always() }}
run: rake upload:unlock