-
Notifications
You must be signed in to change notification settings - Fork 8
108 lines (105 loc) · 3.9 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
on:
push:
tags:
- 'v*.*.*'
- 'v*.*'
name: Make release
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version_tag: ${{ steps.version_tag.outputs.version_tag }}
steps:
- name: Set release version in env
id: version_tag
run: echo ::set-output name=version_tag::${GITHUB_REF#refs/*/}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.version_tag.outputs.version_tag }}
draft: true
prerelease: false
build:
needs: create_release
env:
CHEZ_SCHEME_VERSION: '10.0.0'
strategy:
matrix:
config:
- os: macos
arch: x64
# macos-12 for x64 builds
# https://github.com/actions/runner-images?tab=readme-ov-file#available-images
runs_on: macos-12
BUNDLE_EXT: tar.gz
ASSET_CONTENT_TYPE: application/gzip
OSNAME: macOS
- os: macos
arch: arm64
runs_on: macos-latest
BUNDLE_EXT: tar.gz
ASSET_CONTENT_TYPE: application/gzip
OSNAME: macOS
- os: ubuntu
arch: x64
runs_on: ubuntu-latest
BUNDLE_EXT: tar.gz
ASSET_CONTENT_TYPE: application/gzip
OSNAME: linux
- os: windows
arch: x64
runs_on: windows-latest
BUNDLE_EXT: zip
ASSET_CONTENT_TYPE: application/zip
OSNAME: windows
name: Upload Release Asset (${{ matrix.config.OSNAME }})
runs-on: ${{ matrix.config.runs_on }}-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Chez cache
id: shen-scheme-chez-cache
uses: actions/cache@v2
with:
path: _build/chez
key: shen-scheme-chez-cache-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ env.CHEZ_SCHEME_VERSION }}
- name: Install deps (Ubuntu)
run: sudo apt-get install -y uuid-dev
if: runner.os == 'linux'
- name: Build and test
run: |
make fetch-kernel
make fetch-prebuilt
make precompile-with-prebuilt
make csversion=$CHEZ_SCHEME_VERSION
make test
- name: Create binary release for ${{ matrix.config.OSNAME }} ${{ matrix.config.arch }}
run: make binary-release
- name: Create source release
if: runner.os == 'linux'
run: make source-release
- name: Upload Release Asset (binary for ${{ matrix.config.OSNAME }} ${{ matrix.config.arch }})
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./_dist/shen-scheme-${{ needs.create_release.outputs.version_tag }}-${{ matrix.config.OSNAME }}-bin.${{ matrix.config.BUNDLE_EXT }}
asset_name: shen-scheme-${{ needs.create_release.outputs.version_tag }}-${{ matrix.config.OSNAME }}-bin.${{ matrix.config.BUNDLE_EXT }}
asset_content_type: ${{ matrix.config.ASSET_CONTENT_TYPE }}
- name: Upload Release Asset (sources)
if: runner.os == 'linux'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./_dist/shen-scheme-${{ needs.create_release.outputs.version_tag }}-src.${{ matrix.config.BUNDLE_EXT }}
asset_name: shen-scheme-${{ needs.create_release.outputs.version_tag }}-src.${{ matrix.config.BUNDLE_EXT }}
asset_content_type: ${{ matrix.config.ASSET_CONTENT_TYPE }}