diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml new file mode 100644 index 0000000..4a4e748 --- /dev/null +++ b/.github/workflows/pipeline.yaml @@ -0,0 +1,37 @@ +name: gdb-static-pipeline + +on: + pull_request: + branches: + - '*' + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: sudo apt-get install -y wget + + - name: Build + run: make build -j$((`nproc`+1)) + + - name: Pack + run: make pack + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: gdb-static + path: build/artifacts/gdb-static*.tar.gz + + - name: Publish release + if: github.event_name == 'push' + uses: softprops/action-gh-release@v2 + with: + files: build/artifacts/gdb-static*.tar.gz diff --git a/Makefile b/Makefile index a38467c..d946ad2 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ ARCHS := x86_64 arm aarch64 powerpc TARGETS := $(addprefix build-, $(ARCHS)) +PACK_TARGETS := $(addprefix pack-, $(ARCHS)) -.PHONY: clean help download_packages build patch-gdb build-docker-image $(TARGETS) +.PHONY: clean help download_packages build patch-gdb build-docker-image $(TARGETS) $(PACK_TARGETS) help: @echo "Usage:" @@ -47,6 +48,13 @@ $(TARGETS): build-%: download-packages patch-gdb build-docker-image --rm --volume .:/app/gdb gdb-static env TERM=xterm-256color \ /app/gdb/src/build.sh $* /app/gdb/build/ /app/gdb/src/gdb_static.patch +pack: $(PACK_TARGETS) + +$(PACK_TARGETS): pack-%: build-% + if [ ! -f "build/artifacts/gdb-static-$*.tar.gz" ]; then \ + tar -czf "build/artifacts/gdb-static-$*.tar.gz" -C "build/artifacts/$*" .; \ + fi + clean: rm -rf build # Kill and remove all containers of image gdb-static diff --git a/src/download_packages.sh b/src/download_packages.sh index e1488cd..84634cb 100755 --- a/src/download_packages.sh +++ b/src/download_packages.sh @@ -7,8 +7,8 @@ script_dir=$(dirname "$0") # List of package URLs to download PACKAGE_URLS=( "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz" - "https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz" - "https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.xz" + "https://ftp.gnu.org/pub/gnu/gmp/gmp-6.3.0.tar.xz" + "https://ftp.gnu.org/pub/gnu/mpfr/mpfr-4.2.1.tar.xz" "https://ftp.gnu.org/gnu/gdb/gdb-15.1.tar.xz" )