Skip to content

Commit

Permalink
build: github workflows for triggering docable-tray builds (master an…
Browse files Browse the repository at this point in the history
…d releases)
  • Loading branch information
ssmirr committed Dec 24, 2020
1 parent cd8de71 commit 198f651
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/trigger_installer_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build installers

on:
release:
types: [ created ]

jobs:
build:
name: Build release binary
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: |
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \
--request POST \
--data '{"event_type": "build_release_installers", "client_payload": { "upload_url": "${{ steps.get_release.outputs.upload_url }}"}}' \
https://api.github.com/repos/ottomatica/docable.app/dispatches
42 changes: 42 additions & 0 deletions .github/workflows/trigger_preview_installer_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build preview installers

on:
push:
branches: [ master ]

jobs:
build:
name: Build release binary
runs-on: ubuntu-latest
steps:

- id: get_release_upload_url
name: Compute needed variables
run: |
tag="preview"
echo "::set-output name=tag::$tag"
upload_url=$(curl -sL https://api.github.com/repos/${{github.repository}}/releases?access_token=${{ secrets.GITHUB_TOKEN }} | jq -r --arg TAG "$tag" '.[] | select(.tag_name==$TAG) | .upload_url')
echo ::set-output name=upload_url::$upload_url
- name: Remove old release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: preview
assets: |
docable-tray.exe
- name: Remove old release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: preview
assets: |
docable-tray.dmg
- run: |
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \
--request POST \
--data '{"event_type": "build_preview_installers", "client_payload": { "upload_url": "${{ steps.get_release_upload_url.outputs.upload_url }}"}}' \
https://api.github.com/repos/ottomatica/docable.app/dispatches

0 comments on commit 198f651

Please sign in to comment.