From a685cc35a038e1dc6f8741540cae3f128871d05c Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Wed, 6 Jan 2021 14:11:55 +0100 Subject: Introduce a GitHub Workflow to build a binary packages This workflow will specifically build a package for amd64 machines using a GNU libc, but allows for extending into other territories later on. Using this, we *should* be able to automatically build for Windows and Mac users too, solving that problem forever if someone wants to spend some time setting it up. Once other architectures for Linux-based systems gets introduced on GitHub Actions, these could be build in a similar manner too. --- .github/workflows/binary-packages.yml | 58 +++++++++++++++++++++++++++++++++++ .github/workflows/pre-release.yml | 26 ++++++++++++++++ .github/workflows/release.yml | 26 ++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 .github/workflows/binary-packages.yml create mode 100644 .github/workflows/pre-release.yml create mode 100644 .github/workflows/release.yml (limited to '.github') diff --git a/.github/workflows/binary-packages.yml b/.github/workflows/binary-packages.yml new file mode 100644 index 0000000..6292b91 --- /dev/null +++ b/.github/workflows/binary-packages.yml @@ -0,0 +1,58 @@ +name: Binary Packages + +on: + release: + types: + - created + - released + - prereleased + +jobs: + amd64-gnu: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Deduce release + uses: bruceadams/get-release@v1.2.2 + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Prepare + run: | + sudo apt update + sudo apt install -y cpanminus curl gcc make + cpanm -v ExtUtils::Command Pod::Usage + + - name: Fetch + run: | + ./bin/rstar fetch + + - name: Install + run: | + ./bin/rstar install -p "/tmp/ci-$GITHUB_RUN_ID" + + - name: Package + run: | + COMMIT="$(git rev-parse HEAD)" + SOURCE_DATE_EPOCH="$(git log -1 --pretty=format:%at)" + cd -- "/tmp/ci-$GITHUB_RUN_ID" + tar -c \ + --mtime "@$SOURCE_DATE_EPOCH" \ + --mode=go=rX,u+rw,a-s \ + --format=gnu \ + --numeric-owner --owner=0 --group=0 \ + . \ + | gzip -9cn \ + > "/tmp/rakudo-star-amd64-gnu-$GITHUB_SHA.tar.gz" + + - name: Upload + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.deduce_release.outputs.upload_url }} + asset_path: /tmp/rakudo-star-amd64-gnu-${{ env.GITHUB_SHA }}.tar.gz + asset_name: rakudo-star-amd64-gnu-${{ env.GITHUB_REF }}.tar.gz + asset_content_type: application/gzip diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000..4eb0e4d --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,26 @@ +name: Prerelease + +on: + push: + tags: + - '*-rc*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + This is a release candidate of Rakudo Star. It is ment for testing + purposes, to eventually release a production quality release. + draft: false + prerelease: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f73f61c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release + +on: + push: + tags: + - '*' + - '!*-rc*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + This is just a drill, don't panic! + draft: true + prerelease: false -- cgit v1.1