initial commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
build-and-bump-tap:
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r scripts/requirements.txt pyinstaller
|
||||
- name: Build binary
|
||||
run: |
|
||||
pyinstaller --onefile --name planka-cli scripts/planka_cli.py
|
||||
- name: Package tarball
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
TAR="planka-cli-${VERSION}-macos.tar.gz"
|
||||
tar -czf "$TAR" -C dist planka-cli
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
|
||||
echo "TAR=$TAR" >> "$GITHUB_ENV"
|
||||
- name: Compute sha256
|
||||
run: |
|
||||
SHA256=$(shasum -a 256 "$TAR" | awk '{print $1}')
|
||||
echo "SHA256=$SHA256" >> "$GITHUB_ENV"
|
||||
- name: Upload release asset
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release upload "$GITHUB_REF_NAME" "$TAR" --clobber
|
||||
- name: Bump tap formula
|
||||
run: |
|
||||
URL="https://github.com/voydz/planka-cli/releases/download/${GITHUB_REF_NAME}/${TAR}"
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
brew tap voydz/homebrew-tap
|
||||
brew bump-formula-pr --tap voydz/homebrew-tap planka-cli \
|
||||
--url "$URL" \
|
||||
--sha256 "$SHA256" \
|
||||
--version "$VERSION"
|
||||
Reference in New Issue
Block a user