Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/default_release_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Prebuilt versions of the toolchains.

To use them, download the appropriate archive and unpack it in your `${HOME}`,
so that the toolchain ends up in (here, for `kindlepw2`)
`${HOME}/x-tools/arm-kindlepw2-linux-gnueabi`. Then add `${HOME}/x-tools/*/bin`
to your `PATH`.

The `x-compile.sh` script included in this repo can do that (and more) for you.
Using `kindlepw2` as an example toolchain again:
- if you need a persistent custom sysroot (e.g., if you intend to build a full dependency chain):
`source ${PWD}/refs/x-compile.sh kindlepw2 env`
- if you just need a compiler:
`source ${PWD}/refs/x-compile.sh kindlepw2 env bare`
42 changes: 40 additions & 2 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ concurrency:
on: [push, pull_request]

jobs:

toolchain:

runs-on: ubuntu-latest
container:
image: koreader/kobase:0.4.0-22.04
Expand All @@ -21,7 +23,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1

- name: Install deps
run: |
Expand All @@ -34,8 +36,44 @@ jobs:
- name: Tar artifacts
run: tar -C ~ -czf ${{ matrix.tc }}.tar.gz x-tools

- name: Uploading artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tc }}
path: ${{ matrix.tc }}.tar.gz

release:

if: ${{ !cancelled() && startsWith(github.ref, 'refs/tags/') }}
needs: toolchain

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: artifacts

- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
# Check if release already exists.
gh release list --json name,tagName,isDraft,createdAt,publishedAt | jq --color-output --exit-status --raw-output '.[] | select(.tagName == "${{ github.ref_name }}") | if .tagName == "" then halt_error end' ||
# And create it if it does not.
gh release create '${{ github.ref_name }}' --draft --notes-file .github/default_release_notes.md --title 'koxtoolchain ${{ github.ref_name }}' --verify-tag

- name: Upload release artifacts
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload '${{ github.ref_name }}' artifacts/* --clobber
Loading