diff options
author | Patrick Spek <p.spek@tyil.nl> | 2021-01-06 14:11:55 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2021-01-06 14:11:55 +0100 |
commit | a685cc35a038e1dc6f8741540cae3f128871d05c (patch) | |
tree | a6b5540bf0c862e94544c2fe0f4b495f66377d96 /.github/workflows | |
parent | 53ce2c57f762b0d1967633a815a3dcb08b4bc268 (diff) |
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.
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/binary-packages.yml | 58 | ||||
-rw-r--r-- | .github/workflows/pre-release.yml | 26 | ||||
-rw-r--r-- | .github/workflows/release.yml | 26 |
3 files changed, 110 insertions, 0 deletions
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 |