diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b2662f0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,61 @@ +name: build + +on: + push: + branches: "*" + +jobs: + build: + strategy: + matrix: + target: + - aarch64-linux-musl + - armv7-linux-musleabihf + - x86_64-linux-musl + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: true + - run: | + cp config.mak musl-cross-make + make -C musl-cross-make 2>&1 >> build-$TARGET.log + make -C musl-cross-make install 2>&1 >> build-$TARGET.log + tar -czvf xcc-$TARGET.tar.gz /opt/xcc + env: + TARGET: ${{ matrix.target }} + - uses: actions/upload-artifact@v3 + with: + name: xcc-${{ matrix.target }}.tar.gz + path: xcc-${{ matrix.target }}.tar.gz + - uses: actions/upload-artifact@v3 + with: + name: build-${{ matrix.target }}.log + path: build-${{ matrix.target }}.log + + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + path: artifacts + - uses: actions/github-script@v6 + with: + script: | + const version = context.sha.substring(0, 8); + + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `refs/tags/${version}`, + sha: context.sha + }); + + core.setOutput('version', version); + id: create-tag + - uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.create-tag.outputs.version }} + files: artifacts/**/*.tar.gz + needs: build diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d8dc39e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "musl-cross-make"] + path = musl-cross-make + url = https://github.com/richfelker/musl-cross-make diff --git a/config.mak b/config.mak new file mode 100644 index 0000000..943cb2b --- /dev/null +++ b/config.mak @@ -0,0 +1,9 @@ +MUSL_VER = 1.2.3 +GCC_VER = 11.2.0 + +GCC_CONFIG += --enable-default-pie + +DL_CMD = curl --retry 3 -C - -L -s -o +SHA1_CMD = shasum -a 1 -c + +OUTPUT = /opt/xcc diff --git a/musl-cross-make b/musl-cross-make new file mode 160000 index 0000000..fe91582 --- /dev/null +++ b/musl-cross-make @@ -0,0 +1 @@ +Subproject commit fe915821b652a7fa37b34a596f47d8e20bc72338