How to set pacman-mirrors when building an ISO through github actions?

I am building a Manjaro ISO in GITHUB ACTIONS

Building your custom Manjaro ISO via Github Actions CI - YouTube

manjaro/manjaro-iso-action: Install prerequisites for building Manjaro on ubuntu (github.com)

I watched these 2 and did not found where to configure pacman-mirrors. Another problem is that github actions do not work in China (my country) so I want to know which mirror is fastest and recommended

This is my build.yaml:

name: kde_iso_build

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  prepare-release:
    runs-on: ubuntu-20.04
    steps:
      - 
        uses: styfle/cancel-workflow-action@0.9.1
        with:
          access_token: ${{ github.token }}
      - 
        id: time
        uses: nanzm/get-time-action@v1.1
        with:
          format: 'YYYY-MM-DD'
    outputs:
      release_tag: ${{ steps.time.outputs.time }}
  build-release:
    runs-on: ubuntu-20.04
    needs: [prepare-release]
    strategy:
      matrix:
        EDITION: [kde]
        BRANCH: [testing]
        SCOPE: [minimal]
    steps:
      - 
        uses: styfle/cancel-workflow-action@0.9.1
        with:
          access_token: ${{ github.token }}
      - 
        id: time
        uses: nanzm/get-time-action@v1.1
        with:
          format: 'YY-MM-DD'   
      -
        name: image-build-upload
        uses: manjaro/manjaro-iso-action@main
        with:
          edition: ${{ matrix.edition }}
          branch: ${{ matrix.branch }}
          scope: ${{ matrix.scope }}
          version: ${{ steps.time.outputs.time }}-development
          kernel: linux518
          code-name: "Testing-Build"
          release-tag: ${{ needs.prepare-release.outputs.release_tag }}
      -
        name: rollback
        if: ${{ failure() || cancelled() }}
        run: |
          echo ${{ github.token }} | gh auth login --with-token
          gh release delete ${{ needs.prepare-release.outputs.release_tag }} -y --repo ${{ github.repository }}

Maybe the answer is envirionment variable

You are using a custom iso-profile - not the default Manjaro - right?

I don’t know if it will work - so my apology beforehand - for a perhaps stupid suggestion.

pacman-mirrors package is installed - but the mirrorlist is not used to install the packages.

The variable build_mirror is set in manjaro-tools.conf and defines which mirror is used for building the iso.so setting it in your profile.conf may override this value

build_mirror=<your-preferred-mirror>

I know I should edit build_mirror in /etc/manjaro-tools/manjaro-tools.conf

but this is in

GITHUB ACTIONS

Use sed commands in the actions to edit the file.

Environment variables are applied in the sequence in which they are set.

The buildiso script will read the manjaro-tools.conf then the iso-profile.conf and therefor you can overwrite the build_mirror variable set in manjaro-tools.conf by setting it again in your profile.conf.

You can test it locally without building by using the -qv arguments.

Copy the file

cp /usr/bin/buildiso $HOME/.local/bin then edit the file and insert like below

edit the file and in the show_profile() function insert the line

msg2 "build mirror: %s" "${build_mirror}"

the run

buildiso -qv -p <your-custom-profile-name>

A few lines below ==> BUILD QUEUE: you will see the content of the build_mirror variable.

Try setting another url in the profile

build_mirror=https://xyx

Save and rerun - note the build_mirror changed

1 Like