-
Notifications
You must be signed in to change notification settings - Fork 26
48 lines (45 loc) · 1.93 KB
/
build.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
name: Build Ruby for GitHub Actions
on: [push]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-16.04', 'ubuntu-18.04', 'macos-latest' ]
ruby: [ 'ruby-2.4.9', 'ruby-2.5.7', 'ruby-2.6.5', 'ruby-2.7.0', 'truffleruby-19.3.0', 'jruby-9.2.9.0' ]
runs-on: ${{ matrix.os }}
steps:
- name: Check if already built
run: '! curl -s --head --fail https://github.com/eregon/ruby-install-builder/releases/download/builds/${{ matrix.ruby }}-${{ matrix.os }}.tar.gz'
- name: Clone ruby-install
run: git clone https://github.com/postmodern/ruby-install.git
- name: Install ruby-install
run: sudo make install
working-directory: ./ruby-install
- name: List versions
run: ruby-install
- name: apt-get update on Ubuntu
run: sudo apt-get update
if: startsWith(matrix.os, 'ubuntu')
- name: Build Ruby
run: ruby-install ${{ matrix.ruby }} -- --disable-install-doc
- name: Install Bundler if needed
run: |
if [ ! -e ~/.rubies/${{ matrix.ruby }}/bin/bundle ]; then
export PATH="$HOME/.rubies/${{ matrix.ruby }}/bin:$PATH"
gem install bundler --no-document
fi
- name: Basic test
run: ~/.rubies/${{ matrix.ruby }}/bin/ruby --version
- name: Create archive
run: tar czf ${{ matrix.ruby }}-${{ matrix.os }}.tar.gz -C ~/.rubies ${{ matrix.ruby }}
- name: Upload Built Ruby
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# curl -s 'https://api.github.com/repos/eregon/ruby-install-builder/releases/tags/builds' | jq -r .upload_url
upload_url: 'https://uploads.github.com/repos/eregon/ruby-install-builder/releases/22533032/assets{?name,label}'
asset_path: ${{ matrix.ruby }}-${{ matrix.os }}.tar.gz
asset_name: ${{ matrix.ruby }}-${{ matrix.os }}.tar.gz
asset_content_type: application/gzip