Skip to content

Commit 3e5cb01

Browse files
authored
Update ci.yml
1 parent eafe4ac commit 3e5cb01

File tree

1 file changed

+13
-91
lines changed

1 file changed

+13
-91
lines changed

.github/workflows/ci.yml

+13-91
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@ jobs:
9090
name: metacall-tarball-${{ matrix.triplet.arch }}
9191
path: release/*
9292

93-
pkg-test:
94-
name: Test Tarball PKG
93+
test:
94+
name: Test
9595
needs: build
9696
strategy:
9797
fail-fast: false
9898
matrix:
99+
extension: ["tar.gz", "pkg"]
99100
triplet: [
100101
{os: macos-13, arch: amd64, install: "/usr/local"},
101102
{os: macos-14, arch: arm64, install: "/opt/homebrew"}
@@ -158,100 +159,21 @@ jobs:
158159
with:
159160
name: metacall-tarball-${{ matrix.triplet.arch }}
160161

161-
# Install from package
162-
- name: Install MetaCall package
162+
- name: Install MetaCall from package
163+
if: ${{ matrix.extension }} == 'pkg'
163164
run: sudo installer -pkg "metacall-tarball-macos-${{ matrix.triplet.arch }}.pkg" -target /
164165

165-
# Test the package in a clean environment
166-
- name: Test
167-
run: |
168-
export PATH="${{ matrix.triplet.install }}/bin:$PATH"
169-
./test.sh
170-
171-
# Release package
172-
- name: Release
173-
uses: softprops/action-gh-release@v2
174-
if: startsWith(github.ref, 'refs/tags/')
175-
with:
176-
fail_on_unmatched_files: true
177-
files: |
178-
metacall-tarball-macos-${{ matrix.triplet.arch }}.pkg
179-
180-
tgz-test:
181-
name: Test Tarball TGZ
182-
needs: build
183-
strategy:
184-
fail-fast: false
185-
matrix:
186-
triplet: [
187-
{os: macos-13, arch: amd64, install: "/usr/local"},
188-
{os: macos-14, arch: arm64, install: "/opt/homebrew"}
189-
]
190-
runs-on: ${{ matrix.triplet.os }}
191-
steps:
192-
- name: Check out the repository
193-
uses: actions/checkout@v4
194-
with:
195-
fetch-depth: 0
196-
197-
# Clean up previous dependencies in order to avoid conflicts with brew
198-
- name: Uninstall brew completely
199-
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
200-
201-
- name: Install brew
202-
run: |
203-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
204-
brew uninstall --force --ignore-dependencies node
205-
brew cleanup -s node
206-
brew cleanup --prune-prefix
207-
brew uninstall --force --ignore-dependencies [email protected]
208-
brew cleanup -s [email protected]
209-
brew cleanup --prune-prefix
210-
brew uninstall --force --ignore-dependencies [email protected]
211-
brew cleanup -s [email protected]
212-
brew cleanup --prune-prefix
213-
brew uninstall --force --ignore-dependencies [email protected]
214-
brew cleanup -s [email protected]
215-
brew cleanup --prune-prefix
216-
sudo rm -rf /System/Library/Frameworks/Python.framework/
217-
brew cleanup --prune-prefix
218-
sudo rm -rf /usr/local/bin/2to3
219-
sudo rm -rf /usr/local/bin/2to3-3.11
220-
sudo rm -rf /usr/local/bin/2to3-3.12
221-
sudo rm -rf /usr/local/bin/2to3-3.13
222-
sudo rm -rf /usr/local/bin/idle3
223-
sudo rm -rf /usr/local/bin/idle3.11
224-
sudo rm -rf /usr/local/bin/idle3.12
225-
sudo rm -rf /usr/local/bin/idle3.13
226-
sudo rm -rf /usr/local/bin/pydoc3
227-
sudo rm -rf /usr/local/bin/pydoc3.11
228-
sudo rm -rf /usr/local/bin/pydoc3.12
229-
sudo rm -rf /usr/local/bin/pydoc3.13
230-
sudo rm -rf /usr/local/bin/python3
231-
sudo rm -rf /usr/local/bin/python3-config
232-
sudo rm -rf /usr/local/bin/python3.11
233-
sudo rm -rf /usr/local/bin/python3.12
234-
sudo rm -rf /usr/local/bin/python3.13
235-
sudo rm -rf /usr/local/bin/python3.11-config
236-
sudo rm -rf /usr/local/bin/python3.12-config
237-
sudo rm -rf /usr/local/bin/python3.13-config
238-
brew uninstall --force --ignore-dependencies ruby
239-
brew cleanup -s ruby
240-
brew cleanup --prune-prefix
241-
sudo rm -rf $(brew --repo homebrew/core)
242-
243-
- name: Download the artifact
244-
uses: actions/download-artifact@v4
245-
with:
246-
name: metacall-tarball-${{ matrix.triplet.arch }}
247-
248-
# Test the package in a clean environment
249-
- name: Test
166+
- name: Install MetaCall from tarball
167+
if: ${{ matrix.extension }} == 'tar.gz'
250168
run: |
251169
mkdir distributable
252170
tar -xvzf metacall-tarball-macos-${{ matrix.triplet.arch }}.tar.gz -C `pwd`/distributable
253171
sudo cp -R `pwd`/distributable${{ matrix.triplet.install }}/ ${{ matrix.triplet.install }}/
254172
rm -rf `pwd`/distributable
173+
174+
# Test the package in a clean environment
175+
- name: Test
176+
run: |
255177
export PATH="${{ matrix.triplet.install }}/bin:$PATH"
256178
./test.sh
257179
@@ -262,11 +184,11 @@ jobs:
262184
with:
263185
fail_on_unmatched_files: true
264186
files: |
265-
metacall-tarball-macos-${{ matrix.triplet.arch }}.tar.gz
187+
metacall-tarball-macos-${{ matrix.triplet.arch }}.${{ matrix.extension }}
266188
267189
install-test:
268190
name: Trigger Install Test Workflow
269-
needs: [pkg-test, tgz-test]
191+
needs: test
270192
runs-on: ubuntu-latest
271193
if: startsWith(github.ref, 'refs/tags/v')
272194
steps:

0 commit comments

Comments
 (0)