From 40bcdc6deff83af55b788bce2d5207ed1c95dfed Mon Sep 17 00:00:00 2001 From: daijro Date: Wed, 14 Aug 2024 05:16:42 -0500 Subject: [PATCH] CI/CD: Migrate from Appveyor to Github Actions Migrated to GH Actions to avoid 60 minute time quota, local storage limit, and cache limit. --- .github/workflows/build.yml | 76 +++++++++++++++++++++++++++++++++++++ .gitignore | 3 +- appveyor.yml | 38 ------------------- launcher/go.mod | 4 +- 4 files changed, 80 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7620f1e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,76 @@ +name: Build and Release + +on: + push: + tags: + - "*" + +env: + MOZBUILD_PATH: ${{ github.workspace }}/.mozbuild + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: "1.23" + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y msitools p7zip-full aria2 + + - name: Cache .mozbuild + uses: actions/cache@v2 + with: + path: ${{ env.MOZBUILD_PATH }} + key: ${{ runner.os }}-mozbuild-${{ hashFiles('**/Makefile') }} + restore-keys: | + ${{ runner.os }}-mozbuild- + + - name: Setup and bootstrap + run: | + make setup-minimal + make mozbootstrap + mkdir -p dist + + - name: Build + run: | + python3 ./multibuild.py --target linux windows macos --arch x86_64 + + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: CamoufoxBuilds + path: dist/* + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + 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 diff --git a/.gitignore b/.gitignore index 1aef99b..87197cd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /.vscode _old/ dist/ +bin/ /bundle/fonts/extra launch launch.exe @@ -12,4 +13,4 @@ launch.exe __pycache__/ *.pyc wget-log -*.kate-swp \ No newline at end of file +*.kate-swp diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 5ca6ac3..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 1.0.{build} - -image: Ubuntu - -environment: - MOZBUILD_PATH: /home/appveyor/.mozbuild - -cache: - - /home/appveyor/.mozbuild - -# Only build on tags -skip_non_tags: true - -init: - - export PATH=/home/appveyor/venv3.11/bin:$PATH - -install: - - sudo apt-get install -y msitools aria2 - - make setup-minimal - - make mozbootstrap - - mkdir -p dist - -build_script: - - python3 ./multibuild.py --target windows macos linux --arch x86_64 - -artifacts: - - path: dist/* - name: CamoufoxBuilds - -deploy: - provider: GitHub - auth_token: - secure: $(GITHUB_TOKEN) - artifact: CamoufoxBuilds - draft: true - prerelease: false - on: - APPVEYOR_REPO_TAG: true diff --git a/launcher/go.mod b/launcher/go.mod index 322cee8..ff40e83 100644 --- a/launcher/go.mod +++ b/launcher/go.mod @@ -1,7 +1,7 @@ module launch -go 1.22.5 +go 1.23 require github.com/mileusna/useragent v1.3.4 -require github.com/goccy/go-json v0.10.3 // indirect +require github.com/goccy/go-json v0.10.3