-
Notifications
You must be signed in to change notification settings - Fork 2
117 lines (103 loc) · 2.98 KB
/
build-and-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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
name: Build 🔨 and Release 🚀
on:
push:
branches:
- '**'
tags-ignore:
- '**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- architecture: amd64
artifact: ebs-bootstrap-linux-x86_64
- architecture: arm64
artifact: ebs-bootstrap-linux-aarch64
name: Build and Test (${{ matrix.architecture }}) 🔨
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.architecture }}
- name: Build and Test 🔨
run: ./build/docker.sh --architecture ${{ matrix.architecture }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
if-no-files-found: error
retention-days: 1
integration-tests:
runs-on: ubuntu-latest
name: Integration Tests 🧪
needs:
- test
steps:
- name: Checkout code 🛒
uses: actions/checkout@v4
- name: Setup bats 🦇
uses: bats-core/[email protected]
with:
bats-version: 1.11.0
- name: Download artifacts 📥
uses: actions/download-artifact@v4
with:
pattern: ebs-bootstrap-*
merge-multiple: true
- name: Make executable
shell: bash
run: |
set -euo pipefail
mv ebs-bootstrap-linux-x86_64 ebs-bootstrap
chmod +x ebs-bootstrap
- name: Setup tests ⚙️
run: bats bats/setup.bats
- name: Test ext4 🧪
run: bats bats/ext4.bats
- name: Test xfs 🧫
run: bats bats/xfs.bats
release:
if: ${{ github.ref_name == github.event.repository.default_branch }} # Only release from the default branch
runs-on: ubuntu-latest
name: Release 🚀
needs:
- integration-tests
permissions:
contents: write
id-token: write
steps:
- name: Checkout code 🛒
uses: actions/checkout@v4
- name: Download artifacts 📥
uses: actions/download-artifact@v4
with:
pattern: ebs-bootstrap-*
merge-multiple: true
- id: version
name: Get next version 🧮
uses: reecetech/[email protected]
with:
scheme: semver
increment: patch
- id: github-release
name: Create Github Release 📦
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.v-version }}
prerelease: false
draft: false
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
files: |
ebs-bootstrap-linux-*
- id: push-short-tag
name: Create release short tag 🏷
uses: richardsimko/[email protected]
with:
tag_name: ${{ steps.version.outputs.major-v-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}