Skip to content

Commit

Permalink
CI/CD: Use target os matrix & fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
daijro committed Aug 16, 2024
1 parent e46bcb3 commit b900bb7
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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

0 comments on commit b900bb7

Please sign in to comment.