-
-
Notifications
You must be signed in to change notification settings - Fork 24
93 lines (79 loc) · 2.94 KB
/
darwin_build.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
name: Darwin Package Build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
LOG_LEVEL: debug
jobs:
dist_darwin:
runs-on: macos-11
steps:
-
name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.2.1'
- # Reference: https://github.com/actions/checkout#Checkout-multiple-repos-side-by-side
name: Download distribution-scripts sources
uses: actions/checkout@v4
with:
path: distribution-scripts
-
name: Download crystal sources
uses: actions/checkout@v4
with:
repository: crystal-lang/crystal
path: crystal
fetch-tags: true
fetch-depth: 0
-
name: Restore Omnibus Depenedcies' cache
uses: actions/cache@v3
with:
path: distribution-scripts/omnibus/vendor/bundler
key: ${{ runner.os }}-omnibus-bundler-${{ hashFiles('distribution-scripts/omnibus/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-omnibus-bundler-
${{ runner.os }}-
-
name: Install Omnibus Depenedcies
run: |
cd distribution-scripts/omnibus
bundle install --path vendor/bundler
-
name: Create build folders
run: |
sudo mkdir -p /opt/crystal
sudo chown $(whoami) /opt/crystal/
sudo mkdir -p /var/cache
sudo chown $(whoami) /var/cache
-
name: Build Dawin package
run: |
make -C distribution-scripts/darwin \
OMNIBUS_OPTS="--log-level ${{ env.LOG_LEVEL }} --override use_git_caching:false" \
CRYSTAL_REPO=$GITHUB_WORKSPACE/crystal \
CRYSTAL_SRC=$GITHUB_WORKSPACE/crystal \
CRYSTAL_SHA1=master \
CRYSTAL_VERSION=1.11.0 \
PACKAGE_ITERATION=1 \
LLVM_VERSION=15.0.7 \
PREVIOUS_CRYSTAL_RELEASE_DARWIN_TARGZ=https://github.com/crystal-lang/crystal/releases/download/1.10.1/crystal-1.10.1-1-darwin-universal.tar.gz
- # Reference: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
name: Extract the package name to be used for the artifact name
run: |
cd distribution-scripts/darwin/build
ls -la
filename=$(ls -1 crystal-*.tar.gz)
echo "ARTIFACT_NAME=${filename%.tar.gz}" >> "$GITHUB_ENV"
- # When an Artifact is uploaded, all the files are assembled into an immutable Zip archive.
# https://github.com/actions/upload-artifact#zip-archives
name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: distribution-scripts/darwin/build/*
retention-days: 1
if-no-files-found: error
compression-level: 0 # package is already compressed