-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (73 loc) · 3.04 KB
/
main.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
name: Create Release
on:
push:
branches:
- main
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for creating release
name: Build packages
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set executable permission for make-chromium.sh
run: |
chmod +x tools/make-chromium.sh
chmod +x tools/make-firefox.sh
- name: Get release version
id: release_version
run: |
echo "VERSION=$(< VERSION)" > $GITHUB_OUTPUT
- name: Assemble release notes
run: |
> release.body.txt
echo "Version: ${{ steps.release_version.outputs.VERSION }}" >> release.body.txt
echo "Changes:" >> release.body.txt
git log --pretty=format:"- %s" -- . ":(exclude).github" >> release.body.txt
- name: Update manifest.json for Firefox
run: |
version=${{ steps.release_version.outputs.VERSION }}
jq --arg version "$version" '.version = $version' platform/firefox/manifest.json > manifest_temp.json && mv manifest_temp.json platform/firefox/manifest.json
- name: Update manifest.json for Chromium
run: |
version=${{ steps.release_version.outputs.VERSION }}
jq --arg version "$version" '.version = $version' platform/chromium/manifest.json > manifest_temp.json && mv manifest_temp.json platform/chromium/manifest.json
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ steps.release_version.outputs.VERSION }}
release_name: ${{ steps.release_version.outputs.VERSION }}
draft: true
prerelease: true
body_path: release.body.txt
- name: Build packages
run: |
tools/make-chromium.sh ${{ steps.release_version.outputs.VERSION }}
tools/make-firefox.sh ${{ steps.release_version.outputs.VERSION }}
- name: Upload Chromium package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/build/amazonRedirectPlus_${{ steps.release_version.outputs.VERSION }}.chromium.zip
asset_name: amazonRedirectPlus_${{ steps.release_version.outputs.VERSION }}.chromium.zip
asset_content_type: application/octet-stream
- name: Upload Firefox package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/build/amazonRedirectPlus_${{ steps.release_version.outputs.VERSION }}.firefox.xpi
asset_name: amazonRedirectPlus_${{ steps.release_version.outputs.VERSION }}.firefox.xpi
asset_content_type: application/octet-stream