@@ -2,150 +2,55 @@ name: WasmCloud Release
2
2
3
3
on :
4
4
push :
5
+ branches : [main]
5
6
tags : ["v*"] # Push events to matching v*, i.e. v1.0, v20.15.10
6
7
workflow_dispatch : # Allow manual creation of artifacts without a release
7
8
pull_request :
8
9
branches : [main]
9
- env :
10
- otp-version : 25
11
- elixir-version : 1.14.3
12
10
13
11
jobs :
14
- create-static-macos :
15
- if : ${{ startswith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
16
- name : Static macOS release
17
- strategy :
18
- matrix :
19
- os : [macos-11]
20
- include :
21
- - os : macos-11
22
- rust-target : x86_64-apple-darwin
23
- release-tarball : x86_64-macos-static.tar.gz
24
- working-directory : wasmcloud_host
25
- runs-on : ${{ matrix.os }}
26
- env :
27
- working-directory : ${{ matrix.working-directory }}
28
- MIX_ENV : release_prod
29
- SECRET_KEY_BASE : ${{ secrets.WASMCLOUD_HOST_SECRET_KEY_BASE }}
30
- steps :
31
- - uses : actions/checkout@v3
32
- - uses : dtolnay/rust-toolchain@stable
33
- - name : run macos script
34
- shell : bash
35
- run : |
36
- bash .github/workflows/static_macos
37
- tar -czvf ${{ matrix.release-tarball }} -C wasmcloud_host/_build/prod/rel/bakeware wasmcloud_host
38
- - name : Upload artifact
39
- uses : actions/upload-artifact@v2
40
- with :
41
- name : ${{ matrix.release-tarball }}
42
- path : ${{ matrix.release-tarball }}
43
-
44
- create-mix-releases :
45
- # Run on tag push or on manual dispatch. Release will not be created for manual dispatch
46
- if : ${{ (startswith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch') && startswith(github.repository.name, 'wasmcloud') }}
47
- name : Mix release
12
+ build-darwin-nif :
48
13
strategy :
49
- fail-fast : false
50
14
matrix :
51
- os : [ubuntu-20.04, windows-2019, macos-11]
52
- working-directory : [wasmcloud_host, host_core]
53
- include :
54
- - os : ubuntu-20.04
55
- rust-target : x86_64-unknown-linux-gnu
56
- release-tarball : x86_64-linux.tar.gz
57
- working-directory : wasmcloud_host
58
- - os : windows-2019
59
- rust-target : x86_64-pc-windows-gnu
60
- release-tarball : x86_64-windows.tar.gz
61
- working-directory : wasmcloud_host
62
- - os : macos-11
63
- rust-target : x86_64-apple-darwin
64
- release-tarball : x86_64-macos.tar.gz
65
- working-directory : wasmcloud_host
66
- - os : ubuntu-20.04
67
- rust-target : x86_64-unknown-linux-gnu
68
- release-tarball : x86_64-linux-core.tar.gz
69
- working-directory : host_core
70
- - os : windows-2019
71
- rust-target : x86_64-pc-windows-gnu
72
- release-tarball : x86_64-windows-core.tar.gz
73
- working-directory : host_core
74
- - os : macos-11
75
- rust-target : x86_64-apple-darwin
76
- release-tarball : x86_64-macos-core.tar.gz
77
- working-directory : host_core
78
- runs-on : ${{ matrix.os }}
79
- env :
80
- working-directory : ${{ matrix.working-directory }}
81
- MIX_ENV : release_prod
82
- SECRET_KEY_BASE : ${{ secrets.WASMCLOUD_HOST_SECRET_KEY_BASE }}
15
+ config :
16
+ - host : macos-latest
17
+ target : aarch64-apple-darwin
83
18
84
- steps :
85
- - uses : actions/checkout@v3
86
-
87
- # Install Rust
88
- - run : rustup toolchain install stable --profile minimal
89
-
90
- # Install erlang/OTP and elixir
91
- - name : Install erlang and elixir
92
- if : ${{ startswith(matrix.os, 'ubuntu') || startswith(matrix.os, 'windows') }}
93
- uses : erlef/setup-beam@v1
94
- with :
95
- otp-version : " =${{ env.otp-version }}"
96
- elixir-version : " ${{ env.elixir-version }}"
97
- install-hex : true
98
- install-rebar : true
99
- - name : Install erlang and elixir
100
- if : ${{ startswith(matrix.os, 'macos') }}
101
- run : |
102
- brew install erlang
103
- brew install elixir
19
+ - host : macos-latest
20
+ target : x86_64-apple-darwin
104
21
105
- - name : Retrieve Mix Dependencies Cache
106
- if : ${{ !startswith(matrix.os, 'windows') }} # Windows gets angry about not owning files if you restore from cache
107
- uses : actions/cache@v2
108
- id : mix-cache # id to use in retrieve action
109
- with :
110
- path : |
111
- ${{ env.working-directory }}/deps
112
- key : ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('${{ env.working-directory }}/mix.exs', '${{ env.working-directory }}/mix.lock') }}
113
-
114
- - name : Install Mix Dependencies
115
- working-directory : ${{env.working-directory}}
116
- shell : bash
117
- run : |
118
- mix local.rebar --force
119
- mix local.hex --force
120
- mix deps.get
121
-
122
- - name : Compile Elixir
123
- working-directory : ${{env.working-directory}}
124
- shell : bash
125
- run : |
126
- mix compile
127
-
128
- - name : Compile Phoenix Assets
129
- if : ${{ env.working-directory == 'wasmcloud_host' }}
130
- working-directory : ${{env.working-directory}}
131
- shell : bash
132
- run : |
133
- make esbuild
134
-
135
- - name : Create Mix Release
136
- working-directory : ${{env.working-directory}}
137
- shell : bash
138
- run : |
139
- mix release
140
- cd _build/${{ env.MIX_ENV }}/rel/${{env.working-directory}}
141
- tar -czvf ${{ matrix.release-tarball }} bin erts-* lib releases
142
- mv ${{ matrix.release-tarball }} ../../../../
22
+ name : nif-${{ matrix.config.target }}
23
+ runs-on : ${{ matrix.config.host }}
24
+ steps :
25
+ - uses : actions/checkout@v3
26
+ - uses : ./.github/actions/install-nix
27
+ with :
28
+ cachixAuthToken : ' ${{ secrets.CACHIX_AUTH_TOKEN }}'
29
+ - uses : ./.github/actions/build-nix
30
+ with :
31
+ package : hostcore_wasmcloud_native-${{ matrix.config.target }}
143
32
144
- - name : Upload artifact
145
- uses : actions/upload-artifact@v2
146
- with :
147
- name : ${{ matrix.release-tarball }}
148
- path : ${{env.working-directory}}/${{ matrix.release-tarball }}
33
+ hostcore :
34
+ needs : build-darwin-nif
35
+ runs-on : ubuntu-latest
36
+ steps :
37
+ - uses : actions/checkout@v3
38
+ - uses : ./.github/actions/install-nix
39
+ with :
40
+ cachixAuthToken : ' ${{ secrets.CACHIX_AUTH_TOKEN }}'
41
+ - uses : actions/download-artifact@v3
42
+ with :
43
+ path : ./aarch64
44
+ name : hostcore_wasmcloud_native-aarch64-apple-darwin
45
+ - uses : actions/download-artifact@v3
46
+ with :
47
+ path : ./x86_64
48
+ name : hostcore_wasmcloud_native-x86_64-apple-darwin
49
+ - run : nix build --override-input hostcore_wasmcloud_native-aarch64-apple-darwin ./aarch64 --override-input hostcore_wasmcloud_native-x86_64-apple-darwin ./x86_64 -L .#hostcore
50
+ # - uses: ./.github/actions/build-nix
51
+ # with:
52
+ # package: hostcore_wasmcloud_native-${{ matrix.config.target }}
53
+ # install-path: ${{ matrix.config.install-path }}
149
54
150
55
# release-hostcore-docker:
151
56
# if: startswith(github.ref, 'refs/tags/') # Only run on tag push
@@ -364,7 +269,7 @@ jobs:
364
269
github-release :
365
270
if : startswith(github.ref, 'refs/tags/') # Only run on tag push
366
271
needs :
367
- [create-mix-releases, release-wasmcloud-docker]
272
+ - hostcore
368
273
runs-on : ubuntu-latest
369
274
steps :
370
275
- name : Download Release Tarballs
0 commit comments