Release #47
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
# https://docs.github.com/ja/actions/reference/context-and-expression-syntax-for-github-actions | |
name: Release | |
on: | |
- push | |
- workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Ruby | |
uses: eregon/use-ruby-action@master | |
with: | |
ruby-version: 2.5 | |
- name: install walter | |
run: ./ci/install-walter-1.3.0.sh | |
- name: build images to test | |
run: | | |
bash -c 'mkdir -p ~/.omnibus_cache/{ubuntu18,centos7}' | |
docker pull ghcr.io/opsrockin/omnibus_base_ubuntu18:master | |
docker pull ghcr.io/opsrockin/omnibus_base_centos7:master | |
docker build -t builder-ubuntu1804 -f docker/Dockerfile.ubuntu1804 . | |
docker build -t builder-centos7 -f docker/Dockerfile.centos7 . | |
~/bin/walter -c ci/walter_build_gh.yml | |
- name: export versions.json | |
run: | | |
gem update --system | |
gem install bundler --no-document | |
bundle config set without "development test ship omnibus" | |
bundle install | |
bundle exec rake > pkg/versions.json | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pkgs | |
path: pkg | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: pkgs | |
path: pkg | |
- name: check files | |
run: find pkg | |
- name: install built pkgs | |
run: | | |
for x in bionic focal ; do | |
docker run -v $GITHUB_WORKSPACE/pkg:/opt/pkg -v $GITHUB_WORKSPACE/test/test_deb.sh:/tmp/test.sh ubuntu:${x} bash /tmp/test.sh | |
done | |
for x in {7..8} ; do | |
docker run -v $GITHUB_WORKSPACE/pkg:/opt/pkg -v $GITHUB_WORKSPACE/test/test_rpm.sh:/tmp/test.sh centos:${x} bash /tmp/test.sh | |
done | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- test | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: pkgs | |
path: pkg | |
- name: Define Version | |
run: | | |
SS_VERSION=$(cat pkg/versions.json | jq -r .serverspec) | |
SI_VERSION=$(cat pkg/versions.json | jq -r .specinfra) | |
echo "RELEASE_VERSION=${SS_VERSION}-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV | |
echo "SPECINFRA_VERSION=${SI_VERSION}" >> $GITHUB_ENV | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ env.RELEASE_VERSION }}" | |
prerelease: false | |
title: "${{ env.RELEASE_VERSION }} (specinfra ${{ env.SPECINFRA_VERSION }})" | |
files: | | |
pkg/* |