forked from walters954/why-salesforce
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (101 loc) · 3.23 KB
/
make-package.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Build and Package
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
setup:
runs-on: ubuntu-latest
outputs:
CHROME: ${{ steps.def_file_name.outputs.CHROME }}
FIREFOX: ${{ steps.def_file_name.outputs.FIREFOX }}
SAFARI: ${{ steps.def_file_name.outputs.SAFARI }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Define prefix
run: echo "AWSF=awsf" >> $GITHUB_ENV
- name: Define file name
id: def_file_name
run: |
echo "CHROME=${{ env.AWSF }}-chrome" >> $GITHUB_OUTPUT
echo "FIREFOX=${{ env.AWSF }}-firefox" >> $GITHUB_OUTPUT
echo "SAFARI=${{ env.AWSF }}-safari" >> $GITHUB_OUTPUT
- name: Setup repo
uses: actions/checkout@v4
- name: Extract current version
id: get_version
run: |
VERSION=$(grep -oP '"version":\s*"\K[0-9.]+' manifest/template-manifest.json)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create versioned directory
run: mkdir -p dist/v${{ env.VERSION }}
chrome:
runs-on: ubuntu-latest
needs: setup
env:
VERSION: ${{ needs.setup.outputs.VERSION }}
CHROME: ${{ needs.setup.outputs.CHROME }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Make Chrome Manifest
run: deno run dev-chrome
- name: Zip Chrome extension
run: zip -r dist/$CHROME-v$VERSION.zip * -x "*.git*" -x "node_modules/*"
- name: Upload Chrome artifact
uses: actions/upload-artifact@v3
with:
name: $CHROME-v$VERSION
path: dist/$CHROME-v$VERSION.zip
firefox:
runs-on: ubuntu-latest
needs: chrome
env:
VERSION: ${{ needs.setup.outputs.VERSION }}
FIREFOX: ${{ needs.setup.outputs.FIREFOX }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Make Firefox Manifest
run: deno run dev-firefox
- name: Zip Firefox extension
run: zip -r dist/$FIREFOX-v$VERSION.zip * -x "*.git*" -x "node_modules/*"
- name: Upload Firefox artifact
uses: actions/upload-artifact@v3
with:
name: $FIREFOX-v$VERSION
path: dist/$FIREFOX-v$VERSION.zip
safari:
runs-on: ubuntu-latest
needs: firefox
env:
VERSION: ${{ needs.setup.outputs.VERSION }}
SAFARI: ${{ needs.setup.outputs.SAFARI }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Make Safari Manifest
run: deno run dev-safari
- name: Zip Safari extension
run: zip -r dist/$SAFARI-v$VERSION.zip * -x "*.git*" -x "node_modules/*"
- name: Upload Safari artifact
uses: actions/upload-artifact@v3
with:
name: $SAFARI-v$VERSION
path: dist/$SAFARI-v$VERSION.zip