bottom/.github/workflows/post-deploy.yml

71 lines
3.1 KiB
YAML
Raw Normal View History

2020-08-19 10:27:57 -04:00
name: Update Packages
on:
release:
types: [published]
jobs:
2020-11-21 15:31:19 -05:00
post-deploy:
2020-08-19 10:27:57 -04:00
runs-on: ubuntu-latest
steps:
2020-08-24 02:02:51 -04:00
- uses: actions/checkout@v2
2020-11-21 15:31:19 -05:00
2020-08-19 10:27:57 -04:00
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
2020-11-21 15:31:19 -05:00
2020-08-19 10:27:57 -04:00
- name: Test env
run: |
echo $RELEASE_VERSION
2020-11-21 15:31:19 -05:00
2020-08-24 02:36:50 -04:00
- name: Make sure you're not on master...
run: |
if [[ $RELEASE_VERSION == "master" ]]; then
exit 1
fi
2020-11-21 15:31:19 -05:00
- 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";
curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_i686-pc-windows-msvc.zip";
curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_x86_64-pc-windows-msvc.zip";
2020-11-21 15:31:19 -05:00
- name: Execute choco packaging script
run: |
python "./deployment/windows/choco/choco_packager.py" "bottom_i686-pc-windows-msvc.zip" "bottom_x86_64-pc-windows-msvc.zip" $TRAVIS_TAG "./deployment/windows/choco/bottom.nuspec.template" "./deployment/windows/choco/chocolateyinstall.ps1.template" "./deployment/windows/choco/bottom.nuspec" "./deployment/windows/choco/tools/chocolateyinstall.ps1" "./deployment/windows/choco/tools/";
zip -r choco.zip "./deployment/windows/choco/bottom.nuspec" "./deployment/windows/choco/tools/";
- name: Upload choco.zip to release
uses: svenstaro/upload-release-action@2.1.0
with:
repo_token: ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }}
file: choco.zip
tag: ${{ env.RELEASE_VERSION }}
overwrite: true
- name: Execute Homebrew 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";
2020-11-21 15:31:19 -05:00
- name: Upload bottom.rb to release
uses: svenstaro/upload-release-action@2.1.0
with:
repo_token: ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }}
file: bottom.rb
2020-08-24 02:22:33 -04:00
tag: ${{ env.RELEASE_VERSION }}
overwrite: true
2020-11-21 15:31:19 -05:00
2020-08-19 10:27:57 -04:00
- 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 }} \
2020-08-24 02:22:33 -04:00
--data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'
2020-11-21 15:31:19 -05:00
2020-08-19 10:27:57 -04:00
- 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 }} \
2020-08-24 02:22:33 -04:00
--data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'