Skip to content

Bump docker/setup-qemu-action from 2.2.0 to 3.0.0 #86

Bump docker/setup-qemu-action from 2.2.0 to 3.0.0

Bump docker/setup-qemu-action from 2.2.0 to 3.0.0 #86

Workflow file for this run

name: build-musl-gcc-bins
on:
- push
- pull_request
jobs:
cross:
runs-on: ubuntu-latest
strategy:
matrix:
targets: [x86_64-linux-musl, aarch64-linux-musl]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: richfelker/musl-cross-make
path: musl-cross-make
- name: get musl-cross-make version
id: get-version
run: |
echo "version=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
shell: bash
working-directory: musl-cross-make
- uses: actions/cache@v3.3.1
id: cache
with:
path: cross-${{matrix.targets}}.tar.xz
key: cross-${{matrix.targets}}-${{steps.get-version.outputs.version}}-${{hashFiles('build.sh','config.mak')}}
- name: install apt packages
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo apt-get update -qq
sudo apt-get install -qq build-essential gpg
- name: build
if: steps.cache.outputs.cache-hit != 'true'
run: ./build.sh ${{matrix.targets}}
shell: bash
- name: tar-results
if: steps.cache.outputs.cache-hit != 'true'
run: "mv -v musl-cross-make/output cross-${{matrix.targets}} && tar -cJf cross-${{matrix.targets}}.tar.xz cross-${{matrix.targets}}"
- uses: actions/upload-artifact@v3
with:
name: cross-${{matrix.targets}}
path: cross-${{matrix.targets}}.tar.xz
native:
runs-on: ubuntu-latest
needs: cross
strategy:
matrix:
targets: [x86_64-linux-musl, aarch64-linux-musl]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: richfelker/musl-cross-make
path: musl-cross-make
- name: get musl-cross-make version
id: get-version
run: |
echo "version=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
shell: bash
working-directory: musl-cross-make
- uses: actions/cache@v3.3.1
id: cache
with:
path: native-${{matrix.targets}}.tar.xz
key: native-${{matrix.targets}}-${{steps.get-version.outputs.version}}-${{hashFiles('build.sh','config.mak')}}
- name: install apt packages
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo apt-get update -qq
sudo apt-get install -qq build-essential gpg
- name: Docker Setup QEMU
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/setup-qemu-action@v3.0.0
- uses: actions/download-artifact@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
name: cross-${{matrix.targets}}
- name: untar downloaded artifacts
if: steps.cache.outputs.cache-hit != 'true'
run: "tar xf cross-${{matrix.targets}}.tar.xz"
- name: build
if: steps.cache.outputs.cache-hit != 'true'
run: ./build.sh ${{matrix.targets}} cross-${{matrix.targets}}
shell: bash
- name: tar-results
if: steps.cache.outputs.cache-hit != 'true'
run: "mv -v musl-cross-make/output native-${{matrix.targets}} && tar -cJf native-${{matrix.targets}}.tar.xz native-${{matrix.targets}}"
- uses: actions/upload-artifact@v3
with:
name: native-${{matrix.targets}}
path: native-${{matrix.targets}}.tar.xz
release:
needs: [cross, native]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: artifacts
- name: generate changelog by just dumping gcc -V for all built binaries
run: |
for res in artifacts/*/*.tar.xz; do
echo "$res:"
dir=$(mktemp -d)
tar xf $res -C $dir --strip-components=1
$dir/bin/*-gcc -v 2>&1 >> NOTES.txt
done
- name: create release
uses: softprops/action-gh-release@v1
with:
files: "artifacts/*/*.tar.xz"
body_path: NOTES.txt
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}