mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-27 14:40:43 +00:00
49 lines
2 KiB
YAML
49 lines
2 KiB
YAML
name: Update Packages
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
set_env:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set env
|
|
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
|
|
- name: Test env
|
|
run: |
|
|
echo $RELEASE_VERSION
|
|
update_homebrew:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Download packages
|
|
run: |
|
|
curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_x86_64-unknown-linux-gnu.tar.gz";
|
|
curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_x86_64-apple-darwin.tar.gz";
|
|
- name: Execute packaging script
|
|
run: |
|
|
python "./deployment/packager.py" $RELEASE_VERSION "./deployment/macos/homebrew/bottom.rb.template" "./bottom.rb" "SHA256" "./bottom_x86_64-apple-darwin.tar.gz" "./bottom_x86_64-unknown-linux-gnu.tar.gz";
|
|
- name: Upload bottom.rb to release
|
|
uses: svenstaro/upload-release-action@2.1.0
|
|
with:
|
|
repo_token: ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }}
|
|
file: bottom.rb
|
|
tag: $RELEASE_VERSION
|
|
overwrite: true
|
|
update_packages:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Trigger homebrew
|
|
run: |
|
|
curl -X POST https://api.github.com/repos/ClementTsang/homebrew-bottom/dispatches \
|
|
-H 'Accept: application/vnd.github.everest-preview+json' \
|
|
-u ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} \
|
|
--data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'
|
|
- name: Trigger choco
|
|
run: |
|
|
curl -X POST https://api.github.com/repos/ClementTsang/choco-bottom/dispatches \
|
|
-H 'Accept: application/vnd.github.everest-preview+json' \
|
|
-u ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} \
|
|
--data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'
|