Skip to content

Commit a1a4f7f

Browse files
authored
Merge pull request #193 from cachho/fix/ReleaseAssets
Fix/release assets
2 parents 4c0d4ff + 033184d commit a1a4f7f

File tree

1 file changed

+61
-65
lines changed

1 file changed

+61
-65
lines changed

.github/workflows/release.yml

Lines changed: 61 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -9,80 +9,76 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- name: Checkout repository
13-
uses: actions/checkout@v3
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
1414

15-
- name: Cache node modules
16-
uses: actions/cache@v3
17-
with:
18-
path: node_modules
19-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
20-
restore-keys: |
21-
${{ runner.os }}-node-
15+
- name: Cache node modules
16+
uses: actions/cache@v3
17+
with:
18+
path: node_modules
19+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
20+
restore-keys: |
21+
${{ runner.os }}-node-
2222
23-
- name: Install dependencies
24-
run: npm install
23+
- name: Install dependencies
24+
run: npm install
2525

26-
- name: Update manifest versions
27-
id: update_manifests
28-
run: |
29-
RELEASE_VERSION=${{ github.event.release.tag_name }}
30-
RELEASE_VERSION=${RELEASE_VERSION#v} # Strip the 'v' prefix
31-
jq --arg version "$RELEASE_VERSION" '.version = $version' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
32-
jq --arg version "$RELEASE_VERSION" '.version = $version' manifest-v2.json > manifest-v2.tmp && mv manifest-v2.tmp manifest-v2.json
26+
- name: Update manifest versions
27+
id: update_manifests
28+
run: |
29+
RELEASE_VERSION=${{ github.event.release.tag_name }}
30+
RELEASE_VERSION=${RELEASE_VERSION#v} # Strip the 'v' prefix
31+
jq --arg version "$RELEASE_VERSION" '.version = $version' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
32+
jq --arg version "$RELEASE_VERSION" '.version = $version' manifest-v2.json > manifest-v2.tmp && mv manifest-v2.tmp manifest-v2.json
3333
34-
- name: Verify release version
35-
id: verify_version
36-
run: |
37-
RELEASE_VERSION=${{ github.event.release.tag_name }}
38-
RELEASE_VERSION=${RELEASE_VERSION#v} # Strip the 'v' prefix
39-
MANIFEST_VERSION=$(jq -r '.version' manifest.json)
40-
MANIFEST_V2_VERSION=$(jq -r '.version' manifest-v2.json)
41-
if [[ "$RELEASE_VERSION" != "$MANIFEST_VERSION" || "$RELEASE_VERSION" != "$MANIFEST_V2_VERSION" ]]; then
42-
echo "Release version does not match manifest versions"
43-
exit 1
44-
fi
34+
- name: Verify release version
35+
id: verify_version
36+
run: |
37+
RELEASE_VERSION=${{ github.event.release.tag_name }}
38+
RELEASE_VERSION=${RELEASE_VERSION#v} # Strip the 'v' prefix
39+
MANIFEST_VERSION=$(jq -r '.version' manifest.json)
40+
MANIFEST_V2_VERSION=$(jq -r '.version' manifest-v2.json)
41+
if [[ "$RELEASE_VERSION" != "$MANIFEST_VERSION" || "$RELEASE_VERSION" != "$MANIFEST_V2_VERSION" ]]; then
42+
echo "Release version does not match manifest versions"
43+
exit 1
44+
fi
4545
46-
- name: Build permissions
47-
run: chmod +x *build.sh
46+
- name: Build permissions
47+
run: chmod +x *build.sh
4848

49-
- name: Run build script
50-
run: ./build.sh
49+
- name: Run build script
50+
run: ./build.sh
5151

52-
- name: Inspect build
53-
run: ./inspect-build.sh
52+
- name: Inspect build
53+
run: ./inspect-build.sh
5454

55-
- name: Post Build
56-
run: ./post-build.sh
55+
- name: Post Build
56+
run: ./post-build.sh
5757

58-
- name: Upload Chromium zip as artifact
59-
uses: actions/upload-artifact@v3
60-
with:
61-
name: chromium-zip
62-
path: dist/chromium.zip
58+
- name: Upload Chromium zip as artifact
59+
uses: actions/upload-artifact@v3
60+
with:
61+
name: chromium-zip
62+
path: dist/chromium.zip
6363

64-
- name: Upload Firefox zip as artifact
65-
uses: actions/upload-artifact@v3
66-
with:
67-
name: firefox-zip
68-
path: dist/firefox.zip
64+
- name: Upload Firefox zip as artifact
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: firefox-zip
68+
path: dist/firefox.zip
6969

70-
- name: Upload Chromium zip to release
71-
uses: actions/upload-release-asset@v1
72-
env:
73-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74-
with:
75-
upload_url: ${{ github.event.release.upload_url }}
76-
asset_path: dist/chromium.zip
77-
asset_name: chromium.zip
78-
asset_content_type: application/zip
70+
- name: Upload Chromium zip to release
71+
uses: softprops/action-gh-release@v2
72+
if: startsWith(github.ref, 'refs/tags/')
73+
with:
74+
files: dist/chromium.zip
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7977

80-
- name: Upload Firefox zip to release
81-
uses: actions/upload-release-asset@v1
82-
env:
83-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84-
with:
85-
upload_url: ${{ github.event.release.upload_url }}
86-
asset_path: dist/firefox.zip
87-
asset_name: firefox.zip
88-
asset_content_type: application/zip
78+
- name: Upload Firefox zip to release
79+
uses: softprops/action-gh-release@v2
80+
if: startsWith(github.ref, 'refs/tags/')
81+
with:
82+
files: dist/firefox.zip
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)