-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI/CD: Use target os matrix & fix release
- Loading branch information
Showing
1 changed file
with
29 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,15 @@ on: | |
tags: | ||
- "*" | ||
|
||
env: | ||
MOZBUILD_PATH: ${{ github.workspace }}/.mozbuild | ||
|
||
jobs: | ||
run: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: [linux, windows, macos] | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Maximize build space | ||
uses: AdityaGarg8/[email protected] | ||
|
@@ -54,47 +57,48 @@ jobs: | |
- name: Restore .mozbuild cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: ${{ env.MOZBUILD_PATH }} | ||
key: ${{ runner.os }}-mozbuild-always | ||
path: ~/.mozbuild | ||
key: mozbuild-${{ matrix.target }} | ||
|
||
- name: Setup and bootstrap | ||
run: | | ||
make setup-minimal | ||
make mozbootstrap | ||
mkdir -p dist | ||
- name: Build Linux | ||
run: python3 ./multibuild.py --target linux --arch x86_64 | ||
- name: List .mozbuild contents | ||
run: | | ||
ls -R ~/.mozbuild | ||
- name: Build | ||
run: python3 ./multibuild.py --target ${{ matrix.target }} --arch x86_64 | ||
|
||
- name: Save .mozbuild cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: ${{ env.MOZBUILD_PATH }} | ||
key: ${{ runner.os }}-mozbuild-always | ||
path: ~/.mozbuild | ||
key: mozbuild-${{ matrix.target }} | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: CamoufoxBuilds | ||
name: CamoufoxBuilds-${{ matrix.target }} | ||
path: dist/* | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: artifacts | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
files: artifacts/**/* | ||
draft: true | ||
prerelease: false | ||
|
||
- name: Upload Release Assets | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./dist/* | ||
asset_name: CamoufoxBuilds | ||
asset_content_type: application/zip |