-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (82 loc) · 2.81 KB
/
release.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# 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/*