-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
176 lines (156 loc) · 5.26 KB
/
maintenance-linux.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Build Linux
on:
push:
pull_request:
workflow_dispatch:
inputs:
crystal_version:
required: true
default: "master"
type: string
previous_crystal_version:
required: true
default: "1.10.1"
type: string
env:
CRYSTAL_VERSION: "${{ inputs.crystal_version || 'master' }}"
CRYSTAL_SHA1: "${{ inputs.crystal_version || 'master' }}"
PREVIOUS_CRYSTAL_VERSION: "${{ inputs.previous_crystal_version || '1.10.1' }}"
jobs:
build-linux:
name: Build x86 Linux tarballs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: crystal-lang/distribution-scripts
branch: refactor/linux-makefile-build-context
- name: Build linux binaries
working-directory: linux
run: make all #pull_images=true release=true
# - name: Upload tarballs as artifacts
# uses: actions/upload-artifact@v3
# with:
# name: linux-${{ env.CRYSTAL_VERSION }}
# path: linux/build/*.gz
# - name: Upload tarball for use in the next step
# uses: actions/upload-artifact@v3
# with:
# name: tarball
# path: |
# linux/build/*.tar.gz
# !linux/build/*-bundled.tar.gz
build-linux2:
name: Build x86 Linux tarballs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: crystal-lang/distribution-scripts
branch: refactor/linux-makefile-build-context
- name: Build statically linked copiler
uses: docker/build-push-action@v5
with:
file: linux/Dockerfile
push: false
load: true
build-args: |
previous_crystal_release=https://github.com/crystal-lang/crystal/releases/download/${{ env.PREVIOUS_CRYSTAL_VERSION }}/crystal-${{ env.PREVIOUS_CRYSTAL_VERSION }}-1-linux-x86_64.tar.gz
crystal_version=${{ env.CRYSTAL_VERSION }}
crystal_sha1=${{ env.CRYSTAL_SHA1 }}
outputs: |
type=tar,path=linux/crystal-${{ env.CRYSTAL_VERSION }}-1-linux-x86_64.tar
# - name: Upload tarballs as artifacts
# uses: actions/upload-artifact@v3
# with:
# name: linux-${{ env.CRYSTAL_VERSION }}
# path: linux/build/*.gz
- name: Upload tarball for use in the next step
uses: actions/upload-artifact@v3
with:
name: tarball
path: |
linux/build/*.tar.gz
!linux/build/*-bundled.tar.gz
build-arrch64:
name: Build aarch64 Linux tarballs
runs-on: [linux, ARM64]
steps:
- uses: actions/checkout@v3
with:
repository: crystal-lang/distribution-scripts
branch: refactor/linux-makefile-build-context
- name: Build linux binaries
uses: docker://jhass/crystal:1.0.0-alpine-build # this is only to get an environment with make
working-directory: linux
with:
args: make all #pull_images=true release=true
# - name: Upload tarballs as artifacts
# uses: actions/upload-artifact@v3
# with:
# name: linux-${{ env.CRYSTAL_VERSION }}
# path: linux/build/*.gz
- name: Upload tarball for use in the next step
uses: actions/upload-artifact@v3
with:
name: tarball
path: |
linux/build/*.tar.gz
!linux/build/*-bundled.tar.gz
package-docker:
name: Build the docker images
runs-on: ubuntu-latest
needs: build-linux
env:
tag: "crystallang/crystal:${{ inputs.crystal_version || 'master' }}"
steps:
- name: Download the linux tarballs
uses: actions/download-artifact@v3
with:
name: tarball
path: linux/build/
- run: ls linux/build/
- name: Build ubuntu runtime image
uses: docker/build-push-action@v5
with:
target: runtime
file: docker/ubuntu.Dockerfile
build-contexts: tarball=linux/build/
push: false
load: true
tags: "${{ env.tag }}"
- name: Build ubuntu build image
uses: docker/build-push-action@v5
with:
target: build
file: docker/ubuntu.Dockerfile
build-contexts: tarball=linux/build/
push: false
load: true
tags: "${{ env.tag }}-build"
- name: Build alpine runtime image
uses: docker/build-push-action@v5
with:
target: runtime
file: docker/alpine.Dockerfile
build-contexts: tarball=linux/build/
push: false
load: true
tags: "${{ env.tag }}-alpine"
- name: Build alpine build image
uses: docker/build-push-action@v5
with:
target: build
file: docker/alpine.Dockerfile
build-contexts: tarball=linux/build/
push: false
load: true
tags: "${{ env.tag }}-alpine-build"
- name: Inspect ubuntu
run: docker image inspect "${{ env.tag }}"
- name: Inspect ubuntu
run: docker image inspect "${{ env.tag }}-build"
- name: Inspect alpine
run: docker image inspect "${{ env.tag }}-alpine"
- name: Inspect alpine
run: docker image inspect "${{ env.tag }}-alpine-build"