Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Cross compilation #128

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1a6b2fc
enable pdf output format for the command line
Oct 24, 2023
6fb0bdf
add working pdf export
Oct 24, 2023
23ac82d
remove the unnecessary keeping of the temp html file
Oct 24, 2023
148cb80
use correct error kind
Oct 25, 2023
bacdfb7
move pdf render code to own module in the render crate
Oct 26, 2023
9b98d8d
first working import of paged js
Dec 10, 2023
ec12dac
fix the missing code highlighting in pdfs
Dec 11, 2023
26aecc6
improve error message output during the pdf render stage
Dec 11, 2023
72af1ff
add cross-compilation for windows
Oct 23, 2023
36f0e32
fix installation error in pipeline
Oct 23, 2023
7574269
add first experimental cross-compilation for macos and caching for li…
Jan 20, 2024
9586bdc
fix for unrecognized runner.os
Jan 20, 2024
23778ad
try to cache between multiple jobs
Jan 20, 2024
45e5646
try to use shared key between jobs for caching
Jan 20, 2024
ac961f5
lint waits for build too
Jan 20, 2024
bd3c894
fix ubuntu_latest to ubuntu-latest
Jan 20, 2024
b1aad3b
feature: add release artifact to pipeline
Jan 20, 2024
cc2f462
feat: add compiled binaries to release
Jan 23, 2024
99cd069
feat: use shared build workflow
Jan 23, 2024
d72c3d6
fix: remove additional dot in filename
Jan 23, 2024
5cbbab8
fix: remove additional dot in filename
Jan 23, 2024
130ecbe
fix: add missing and between conditions
Jan 23, 2024
db40288
fix: use correct fromJSON method
Jan 23, 2024
68fb836
fix: use correct format for json array
Jan 23, 2024
3f3ff13
fix: use correct JSON formatting in build file
Mar 5, 2024
df9628a
fix: resolve errors after rebase
Mar 5, 2024
7523edc
fix: update upload archive workflow
Mar 6, 2024
101f62b
fix: try to review release please
Mar 6, 2024
cd19e5b
fix: update release please version
Mar 7, 2024
34a8a62
fix: restructure release please to run it first before even building …
Mar 7, 2024
818e0b1
fix: restructure release please to run it first before even building …
Mar 7, 2024
6e9612a
fix: restructure release please to run it first before even building …
Mar 7, 2024
b4848e7
fix: restructure release please to run it first before even building …
Mar 7, 2024
74f8efc
fix: restructure release please to run it first before even building …
Mar 7, 2024
8a4de88
fix: restructure release please to run it first before even building …
Mar 7, 2024
65bdf2f
fix: restructure release please to run it first before even building …
Mar 7, 2024
8f0bde2
fix: restructure release please to run it first before even building …
Mar 7, 2024
b07deb9
fix: restructure release please to run it first before even building …
Mar 7, 2024
7ca4308
fix: restructure release please to run it first before even building …
Mar 7, 2024
bfd7197
fix: restructure release please to run it first before even building …
Mar 7, 2024
7283a8d
fix: restructure release please to run it first before even building …
Mar 7, 2024
c79297a
fix: restructure release please to run it first before even building …
Mar 7, 2024
6341f41
fix: restructure release please to run it first before even building …
Mar 7, 2024
3483d01
fix: restructure release please to run it first before even building …
Mar 7, 2024
c65654a
fix: restructure release please to run it first before even building …
Mar 7, 2024
ee69067
fix: restructure release please to run it first before even building …
Mar 7, 2024
e378576
fix: restructure release please to run it first before even building …
Mar 7, 2024
3b13111
fix: restructure release please to run it first before even building …
Mar 7, 2024
48f0c1c
fix: restructure release please to run it first before even building …
Mar 7, 2024
51dcdd1
fix: restructure release please to run it first before even building …
Mar 7, 2024
383fb4f
fix: restructure release please to run it first before even building …
Mar 7, 2024
1a526f1
fix: restructure release please to run it first before even building …
Mar 7, 2024
327bbde
fix: restructure release please to run it first before even building …
Mar 7, 2024
f04a137
fix: restructure release please to run it first before even building …
Mar 7, 2024
e5a7d1e
fix: restructure release please to run it first before even building …
Mar 7, 2024
0793652
fix: restructure release please to run it first before even building …
Mar 7, 2024
48cd033
fix: restructure release please to run it first before even building …
Mar 7, 2024
0326a03
fix: restructure release please to run it first before even building …
Mar 7, 2024
c834304
fix: restructure release please to run it first before even building …
Mar 7, 2024
318e225
fix: restructure release please to run it first before even building …
Mar 7, 2024
3b5c3de
fix: caching between different workflows currently not working
Mar 7, 2024
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
39 changes: 39 additions & 0 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
workflow_call:
inputs:
os:
type: string
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
release:
type: boolean
default: false
enable-caching:
type: boolean
default: false
upload-artifacts:
type: boolean
default: false

jobs:
build:
name: Build project
strategy:
matrix:
os: ${{ fromJSON(inputs.os) }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: cache
uses: Swatinem/rust-cache@v2
if: ${{ inputs.enable-caching }} && matrix.os == 'ubuntu-latest'
with:
shared-key: "build-files"
- name: Build unimarkup
run: cargo build ${{ inputs.release && '--release' || '' }}
- name: upload archive
if: ${{ inputs.upload-artifacts }}
uses: actions/upload-artifact@v4
with:
name: unimarkup-${{matrix.os}}
path: ./target/release/unimarkup${{ matrix.os == 'windows-latest' && '.exe' || '' }}
38 changes: 38 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ on:
branches:
- main

permissions:
contents: write
pull-requests: write

name: Release Please

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release-created: ${{ steps.release.outputs.release_created }}
tag-name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
release-type: rust
package-name: unimarkup-rs
Expand All @@ -22,3 +30,33 @@ jobs:
{"type":"arch","section":"Architecture/Refactor","hidden":false},
{"type":"chore","section":"Miscellaneous","hidden":true}
]

release-build:
name: Build unimarkup release
needs: release-please
if: ${{ needs.release-please.outputs.release-created }}
uses: ./.github/workflows/build-workflow.yml
with:
release: true
upload-artifacts: true

upload-executables:
runs-on: ubuntu-latest
needs:
- release-please
- release-build
if: ${{ needs.release-please.outputs.release-created }}
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Upload Release Artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository_owner }}/${{ github.event.repository.name }}
run: |
ls -la
mv -v unimarkup-ubuntu-latest/unimarkup ./unimarkup-linux
mv -v unimarkup-windows-latest/unimarkup.exe ./unimarkup-win.exe
mv -v unimarkup-macos-latest/unimarkup ./unimarkup-macos
ls -la
gh release upload ${{ needs.release-please.outputs.tag-name }} ./unimarkup-linux ./unimarkup-win.exe ./unimarkup-macos
33 changes: 23 additions & 10 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,44 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build unimarkup on all systems
uses: ./.github/workflows/build-workflow.yml
with:
os: ${{ github.ref == 'refs/heads/main' && '["ubuntu-latest", "windows-latest", "macos-latest"]' || '["ubuntu-latest"]'}}
enable-caching: false

format:
name: Check Formatting
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Run cargo fmt
run: cargo fmt -- --check
- uses: actions/checkout@v4
- name: Run cargo fmt
run: cargo fmt -- --check

lint:
name: Run Linter (clippy)
runs-on: ubuntu-latest
needs: format
needs: [ format, build ]

steps:
- uses: actions/checkout@v2
- name: Run linter
run: cargo clippy -- -D warnings
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
shared-key: "build-files"
- name: Run linter
run: cargo clippy -- -D warnings

test:
name: Run Tests
runs-on: ubuntu-latest
needs: lint

steps:
- uses: actions/checkout@v2
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
shared-key: "build-files"
- name: Run tests
run: cargo test --verbose