forked from brimdata/zui
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (85 loc) · 3.56 KB
/
win-release-candidate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Brim Windows release candidate creation
on:
push:
branches:
- rc-v*
schedule:
- cron: "5 8 * * *"
workflow_dispatch:
jobs:
build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Extract branch name
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
shell: bash
- uses: actions/setup-go@v2
with:
go-version: "1.16"
- uses: actions/setup-node@v2
with:
cache: yarn
node-version-file: .nvmrc
- if: ${{ !startsWith(steps.extract_branch.outputs.branch, 'rc-v') }}
name: Set version string for ad hoc builds
run: echo "ADHOC_VERSION_STRING=$(npm version preminor --no-git-tag-version --preid prerelease-${GITHUB_SHA:0:8})" >> $GITHUB_ENV
shell: bash
- run: yarn --inline-builds
- run: yarn run build
- name: Build Signed Release
shell: bash
run: |
yarn electron-builder --win
env:
CSC_KEY_PASSWORD: ${{ secrets.WINDOWS_SIGNING_PASSPHRASE }}
CSC_LINK: ${{ secrets.WINDOWS_SIGNING_PFX_BASE64 }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python (needed for Google Cloud Platform)
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Setup Google Cloud Platform
uses: google-github-actions/setup-gcloud@master
env:
CLOUDSDK_PYTHON: ${{ env.pythonLocation }}\python.exe
with:
version: "290.0.1"
project_id: ${{ secrets.GCLOUD_PROJECT_ID }}
service_account_key: ${{ secrets.GCLOUD_CREDENTIAL_RELEASES }}
- if: ${{ startsWith(steps.extract_branch.outputs.branch, 'rc-v') }}
name: "Set bucket path (if this is a release candidate)"
run: echo "BUCKET_PATH=gs://${{ secrets.GCLOUD_BUCKET_RELEASES }}/brim/${{ steps.extract_branch.outputs.branch }}/windows" >> $GITHUB_ENV
shell: bash
- if: ${{ !startsWith(steps.extract_branch.outputs.branch, 'rc-v') }}
name: "Set bucket path (if this is an ad hoc build)"
run: echo "BUCKET_PATH=gs://${{ secrets.GCLOUD_BUCKET_RELEASES }}/brim/${{ env.ADHOC_VERSION_STRING }}/windows" >> $GITHUB_ENV
shell: bash
- name: "Set publicly-available bucket path"
run: echo "PUBLIC_BUCKET_PATH=${BUCKET_PATH/gs:\/\//https://storage.googleapis.com/}" >> $GITHUB_ENV
shell: bash
- name: Upload release artifacts to Google Cloud Storage bucket
env:
CLOUDSDK_PYTHON: ${{ env.pythonLocation }}\python.exe
run: |
gsutil rm -rf ${{ env.BUCKET_path }} || true
gsutil cp dist\installers\Brim-Setup*.exe* dist\installers\latest.yml ${{ env.BUCKET_path }}
- name: Assemble Slack message that points to multiple artifacts
run: |
echo "SLACK_TEXT<<EOF" >> $GITHUB_ENV
echo "New Windows release available -" >> $GITHUB_ENV
for FILENAME in $(find dist/installers -type f -name Brim-Setup\*.exe -exec basename {} \;)
do
echo "\n<${{ env.PUBLIC_BUCKET_PATH }}/$FILENAME|${{ env.BUCKET_PATH }}/$FILENAME>" >> $GITHUB_ENV
done
echo "EOF" >> $GITHUB_ENV
shell: bash
- name: Inform Slack users at Brim HQ of the new artifact
uses: tiloio/slack-webhook-action@v1.1.2
with:
slack_web_hook_url: ${{ secrets.SLACK_WEBHOOK_BRIMLABS_RELEASES }}
slack_json: '{
"username": "release-automation",
"text": "${{ env.SLACK_TEXT }}"
}'