Skip to content

Commit

Permalink
attempt to validate bottles when uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 16, 2025
1 parent 484eeba commit 8a86550
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async function bottle(newVersion: string): Promise<Bottle[]> {
// Save the binary to a file
await Deno.writeFile(binaryFileName, uint8Array)

// Build the directory structure
// Build the directory structure
const cellarPath = `pkgx/${newVersion}`
await run({ cmd: ["mkdir", "-p", `${cellarPath}/bin`] })

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,18 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

- uses: softprops/action-gh-release@v1
- uses: softprops/action-gh-release@v2
with:
name: ${{steps.bump.outputs.name}} v${{ steps.bump.outputs.version }}
tag_name: v${{ steps.bump.outputs.version }}
files: bottles/*
fail_on_unmatched_files: true
make_latest: true
generate_release_notes: true
if: steps.bump.outputs.name

- run: gh release v${{ steps.bump.outputs.version }} upload bottles/* --clobber

test:
needs: bump
strategy:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/validate.bottles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: validate bottles

on:
workflow_dispatch:
release:
types:
- published
- edited

jobs:
smoke:
runs-on: ${{ matrix.x.os }}
strategy:
matrix:
x:
- os: ubuntu-latest
- os: ubuntu-latest
container: ubuntu:focal
- os: macos-latest
container: ${{ matrix.x.container }}
steps:
- uses: actions/checkout@v4

# the “dedicated” homebrew setup action doesn't work in containers
- run: |
apt update --yes && apt install --yes build-essential procps curl file git
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH
if: matrix.x.container == 'ubuntu:focal'
- uses: Homebrew/actions/setup-homebrew@master
if: matrix.x.container != 'ubuntu:focal'

- run: brew install ./pkgx.rb
- run: pkgx semverator satisfies ^1 1.0.0

0 comments on commit 8a86550

Please sign in to comment.