-
Notifications
You must be signed in to change notification settings - Fork 142
54 lines (50 loc) · 1.68 KB
/
artifact-upload.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
name: Artifact Upload
on:
pull_request:
types:
- opened
- reopened
- synchronize
- labeled
jobs:
artifact-upload:
if: contains(github.event.pull_request.labels.*.name, 'package')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set version and SHA
run: |
VERSION=$(node -p "require('./package.json').version")
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})
echo "SHA=$SHA" >> "$GITHUB_ENV"
echo $VERSION
echo $SHA
- uses: actions/setup-node@v3
with:
node-version-file: '.tool-versions'
cache: 'npm'
cache-dependency-path: ./package-lock.json
- name: Install dependencies in repo root
run: npm ci
working-directory: .
- name: Build packages
run: npm run package -- --simple
- name: Uncompress packages
run: |
for PLATFORM in firefox chromium; do
mkdir web-ext-artifacts/ghostery-$PLATFORM
unzip "web-ext-artifacts/ghostery-$PLATFORM.zip" -d "web-ext-artifacts/ghostery-$PLATFORM"
done
- name: Upload Chromium build
uses: actions/upload-artifact@v3
with:
name: ghostery-chromium-${{ env.VERSION }}-${{ env.SHA }}
path: web-ext-artifacts/ghostery-chromium/*
if-no-files-found: error
- name: Upload Firefox build
uses: actions/upload-artifact@v3
with:
name: ghostery-firefox-${{ env.VERSION }}-${{ env.SHA }}
path: web-ext-artifacts/ghostery-firefox/*
if-no-files-found: error