build #1084
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 | |
on: | |
push: | |
branches: | |
- master | |
- build-* # to build without PR | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- '*' | |
schedule: | |
- cron: "30 15 * * *" # 7:30 PST (-8), 8:30 PDT (-7) | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' | |
bundler-cache: true | |
- uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: 0.9.1 | |
- name: Integration test | |
run: bundle exec rake test:integration | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- { os: linux, arch: x86_64 } | |
- { os: linux, arch: i386 } | |
- { os: linux, arch: armhf } | |
- { os: linux, arch: aarch64 } | |
- { os: darwin, arch: x86_64 } | |
- { os: darwin, arch: aarch64 } | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' | |
bundler-cache: true | |
- uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: 0.9.1 | |
- name: Build ${{ matrix.os }}-${{ matrix.arch }} binary | |
run: bundle exec rake release:build:${{ matrix.os }}-${{ matrix.arch }} release:compress | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: mitamae-${{ matrix.arch }}-${{ matrix.os }} | |
path: mitamae-build/ | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
- build | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v1 | |
with: | |
name: mitamae-x86_64-linux | |
path: mitamae-build/ | |
- uses: actions/download-artifact@v1 | |
with: | |
name: mitamae-i386-linux | |
path: mitamae-build/ | |
- uses: actions/download-artifact@v1 | |
with: | |
name: mitamae-armhf-linux | |
path: mitamae-build/ | |
- uses: actions/download-artifact@v1 | |
with: | |
name: mitamae-aarch64-linux | |
path: mitamae-build/ | |
- uses: actions/download-artifact@v1 | |
with: | |
name: mitamae-x86_64-darwin | |
path: mitamae-build/ | |
- uses: actions/download-artifact@v1 | |
with: | |
name: mitamae-aarch64-darwin | |
path: mitamae-build/ | |
- name: Release | |
run: | | |
export VERSION=$(echo "$GITHUB_REF" | sed -e 's!refs/tags/!!') | |
curl -L "https://github.com/tcnksm/ghr/releases/download/${GHR_VERSION}/ghr_${GHR_VERSION}_linux_amd64.tar.gz" | tar xvz | |
"ghr_${GHR_VERSION}_linux_amd64/ghr" -u itamae-kitchen -r mitamae -replace -n "$VERSION" "$VERSION" mitamae-build/ | |
env: | |
GHR_VERSION: v0.13.0 | |
GITHUB_TOKEN: ${{ secrets.githubtoken }} |