-
Notifications
You must be signed in to change notification settings - Fork 51
104 lines (90 loc) · 4.39 KB
/
s3release.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: 'Publish assets to s3'
# Trigger the workflow on pull request activity
on:
release:
# Only use the types keyword to narrow down the activity types that will trigger your workflow.
types: [published, edited]
jobs:
get_release_assets:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: AKIAVVODCRMSJ5MV63VB
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOY_USER_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-2
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLICATION: safe-browser
steps:
- name: Set tag as env
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
- name: lets check tag
run: echo ${{ env.RELEASE_VERSION }}
# set an env var to grab the correct yaml files
- name: set yaml file
shell: bash
run: |
echo ::set-env name=YAML_FILE::"$(echo "latest")"
if [[ $RELEASE_VERSION == *"-alpha"* ]]; then
echo ::set-env name=YAML_FILE::"$(echo "alpha")"
fi
if [[ $RELEASE_VERSION == *"-beta"* ]]; then
echo ::set-env name=YAML_FILE::"$(echo "beta")"
fi
- name: lets check yaml
run: echo ${{ env.YAML_FILE }}
# mac
- name: Download build from s3 for this tag
shell: bash
run: aws s3 cp s3://${{ env.APPLICATION }}/tag-builds/${{ env.RELEASE_VERSION }} . --recursive
# do more...
- name: Check dlded assets
shell: bash
run: ls .
# Upload all the release archives to S3;
# mac
- name: Upload to s3
shell: bash
run: aws s3 cp "${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-mac-x64.dmg" s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-mac/ --acl public-read
- name: Upload to s3
shell: bash
run: aws s3 cp "${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-mac-x64.dmg.blockmap" s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-mac/ --acl public-read
- name: Upload to s3
shell: bash
run: aws s3 cp "${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-mac-x64.zip" s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-mac/ --acl public-read
- name: Upload to s3
shell: bash
run: aws s3 cp "${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-mac-x64.pkg" s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-mac/ --acl public-read
# linux
- name: chmod
run: chmod +x ${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-linux-x64.AppImage
- name: Upload to s3
shell: bash
run: aws s3 cp "${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-linux-x64.zip" s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-linux/ --acl public-read
- name: Upload to s3
shell: bash
run: aws s3 cp "${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-linux-x64.AppImage" s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-linux/ --acl public-read
# win
- name: Upload to s3
shell: bash
run: aws s3 cp "${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-win-x64.exe" s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-win/ --acl public-read
- name: Upload to s3
shell: bash
run: aws s3 cp "${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-win-x64.exe.blockmap" s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-win/ --acl public-read
# YAMLS
- name: Upload to s3
shell: bash
run: aws s3 cp ${{ env.YAML_FILE }}.yml s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-win/ --acl public-read
- name: Upload to s3
shell: bash
run: aws s3 cp ${{ env.YAML_FILE }}-mac.yml s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-mac/ --acl public-read
- name: Upload to s3
shell: bash
run: aws s3 cp ${{ env.YAML_FILE }}-linux.yml s3://${{ env.APPLICATION }}/${{ env.APPLICATION }}-linux/ --acl public-read
# Update the release with artifacts
- name: Release generation
uses: Xotl/cool-github-releases@v1
with:
mode: update
isPrerelease: contains(github.ref, "alpha") || contains(github.ref, "beta")
assets: ${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-mac-x64.dmg;${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-linux-x64.AppImage|application/vnd.appimage;${{ env.APPLICATION }}-${{ env.RELEASE_VERSION }}-win-x64.exe;
github_token: ${{ github.token }}
tag_name: ${{ env.RELEASE_VERSION }}