Clean Ruby workflow
This commit is contained in:
parent
4ff2e14b04
commit
812bbd896d
|
@ -23,10 +23,12 @@ jobs:
|
||||||
FILE: 'libminify_html_ruby_lib.dylib'
|
FILE: 'libminify_html_ruby_lib.dylib'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
-
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: version
|
id: version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo ::set-output name=VERSION::"$([[ "$GITHUB_REF" == refs/tags/v* ]] && echo ${GITHUB_REF#refs/tags/v} || echo '0.0.0')"
|
run: echo ::set-output name=VERSION::"$([[ "$GITHUB_REF" == refs/tags/v* ]] && echo ${GITHUB_REF#refs/tags/v} || echo '0.0.0')"
|
||||||
|
|
||||||
# Install Ruby manually as actions/setup-ruby@v1 does not compile with `--enable-shared`.
|
# Install Ruby manually as actions/setup-ruby@v1 does not compile with `--enable-shared`.
|
||||||
- name: Prepare for rbenv
|
- name: Prepare for rbenv
|
||||||
run: |
|
run: |
|
||||||
|
@ -34,6 +36,7 @@ jobs:
|
||||||
export PATH="$HOME/.rbenv/bin:$PATH"
|
export PATH="$HOME/.rbenv/bin:$PATH"
|
||||||
eval "$(rbenv init -)"
|
eval "$(rbenv init -)"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Get native module file name
|
- name: Get native module file name
|
||||||
id: native_file
|
id: native_file
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -41,12 +44,14 @@ jobs:
|
||||||
RUBY_VERSION: ${{ matrix.ruby }}
|
RUBY_VERSION: ${{ matrix.ruby }}
|
||||||
# PowerShell doesn't support `${...}` syntax.
|
# PowerShell doesn't support `${...}` syntax.
|
||||||
run: echo ::set-output name=NAME::${{ matrix.NAME }}-ruby${RUBY_VERSION%.*}
|
run: echo ::set-output name=NAME::${{ matrix.NAME }}-ruby${RUBY_VERSION%.*}
|
||||||
|
|
||||||
- name: Set up rbenv (macOS)
|
- name: Set up rbenv (macOS)
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
shell: bash -l {0}
|
shell: bash -l {0}
|
||||||
run: |
|
run: |
|
||||||
brew install openssl libyaml libffi
|
brew install openssl libyaml libffi
|
||||||
brew install rbenv
|
brew install rbenv
|
||||||
|
|
||||||
- name: Set up rbenv (Linux)
|
- name: Set up rbenv (Linux)
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
shell: bash -l {0}
|
shell: bash -l {0}
|
||||||
|
@ -57,48 +62,49 @@ jobs:
|
||||||
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
|
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
|
||||||
mkdir -p "$HOME/.rbenv/plugins"
|
mkdir -p "$HOME/.rbenv/plugins"
|
||||||
git clone https://github.com/rbenv/ruby-build.git "$HOME/.rbenv/plugins/ruby-build"
|
git clone https://github.com/rbenv/ruby-build.git "$HOME/.rbenv/plugins/ruby-build"
|
||||||
|
|
||||||
- name: Set up Ruby
|
- name: Set up Ruby
|
||||||
shell: bash -l {0}
|
shell: bash -l {0}
|
||||||
run: |
|
run: |
|
||||||
rbenv install ${{ matrix.ruby }}
|
rbenv install ${{ matrix.ruby }}
|
||||||
rbenv global ${{ matrix.ruby }}
|
rbenv global ${{ matrix.ruby }}
|
||||||
|
|
||||||
- name: Set up Rust (macOS, Linux)
|
- name: Set up Rust (macOS, Linux)
|
||||||
if: runner.os != 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
profile: minimal
|
profile: minimal
|
||||||
default: true
|
default: true
|
||||||
- name: Set up Rust (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable-gnu
|
|
||||||
profile: minimal
|
|
||||||
default: true
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '^1.14.0'
|
go-version: '^1.14.0'
|
||||||
|
|
||||||
- name: Set up GCC (Windows)
|
- name: Set up GCC (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
run: .\.github\workflows\gcc.ps1
|
run: .\.github\workflows\gcc.ps1
|
||||||
|
|
||||||
- name: Run prebuild steps
|
- name: Run prebuild steps
|
||||||
shell: bash
|
shell: bash
|
||||||
run: bash ./prebuild.sh
|
run: bash ./prebuild.sh
|
||||||
|
|
||||||
- name: Build Ruby native library
|
- name: Build Ruby native library
|
||||||
shell: bash -l {0}
|
shell: bash -l {0}
|
||||||
run: cargo build --release
|
run: cargo build -vvv --release
|
||||||
working-directory: ./ruby
|
working-directory: ./ruby
|
||||||
|
|
||||||
- name: Install B2 CLI (macOS, Linux)
|
- name: Install B2 CLI (macOS, Linux)
|
||||||
if: runner.os != 'Windows'
|
if: runner.os != 'Windows'
|
||||||
run: |
|
run: |
|
||||||
sudo pip install setuptools
|
sudo pip install setuptools
|
||||||
sudo pip install --upgrade b2
|
sudo pip install --upgrade b2
|
||||||
|
|
||||||
- name: Install B2 CLI (Windows)
|
- name: Install B2 CLI (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade b2
|
pip install --upgrade b2
|
||||||
|
|
||||||
- name: Upload to B2
|
- name: Upload to B2
|
||||||
run: |
|
run: |
|
||||||
b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }}
|
b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }}
|
||||||
|
|
Loading…
Reference in New Issue