@@ -2,10 +2,10 @@ name: Ruby
22
33on :
44 push :
5- branches :
6- - master
7-
85 pull_request :
6+ schedule :
7+ - cron : ' 35 6 * * *'
8+ workflow_dispatch :
99
1010jobs :
1111 ruby-versions :
@@ -19,12 +19,20 @@ jobs:
1919 needs : ruby-versions
2020 name : CI (${{ matrix.ruby }} / ${{ matrix.os }})
2121 runs-on : ${{ matrix.os }}
22+ outputs :
23+ chksum_ubuntu : ${{ steps.build.outputs.chksum_ubuntu }}
24+ chksum_windows : ${{ steps.build.outputs.chksum_windows }}
2225 strategy :
2326 matrix :
2427 ruby : ${{ fromJson(needs.ruby-versions.outputs.versions) }}
25- os : [ ubuntu-latest , windows-latest ]
28+ os : [ ubuntu-24.04 , windows-latest ]
2629
2730 steps :
31+ - name : git config
32+ run : |
33+ git config --global core.autocrlf false
34+ git config --global core.eol lf
35+ git config --global advice.detachedHead 0
2836 - uses : actions/checkout@v4
2937 - name : Set up Ruby
3038 uses : ruby/setup-ruby@v1
3341 bundler-cache : true
3442 - name : Run the default task
3543 run : bundle exec rake
44+
45+ - id : build
46+ run : |
47+ bundle exec rake build
48+ sum="`sha256sum -b pkg/*`"
49+ echo "$sum"
50+ echo "chksum_${BUILD_PLATFORM%%-*}=$sum" >> $GITHUB_OUTPUT
51+ echo "pkg=${GITHUB_REPOSITORY#*/}" >> $GITHUB_OUTPUT
52+ if : >-
53+ ${{
54+ github.event_name == 'push' &&
55+ (matrix.ruby == needs.ruby-versions.outputs.latest)
56+ }}
57+ env :
58+ BUILD_PLATFORM : ${{ matrix.os }}
59+ shell : bash
60+ - name : Upload package
61+ uses : actions/upload-artifact@v4
62+ with :
63+ path : pkg/*.gem
64+ name : ${{steps.build.outputs.pkg}}-${{matrix.os}}
65+ if : >-
66+ steps.build.outputs.pkg &&
67+ startsWith(matrix.os, 'ubuntu')
68+
69+ comp :
70+ name : ${{ github.workflow }} result
71+ runs-on : ubuntu-latest
72+ needs : [build]
73+ steps :
74+ - run : test "$chksum_ubuntu" = "$chksum_windows"
75+ working-directory :
76+ shell : bash
77+ env :
78+ chksum_ubuntu : ${{ needs.build.outputs.chksum_ubuntu }}
79+ chksum_windows : ${{ needs.build.outputs.chksum_windows }}
0 commit comments