-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Build and Publish refactor #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
01f0070
feat: refactor, added documentation
Mqxx 012a18d
fix: refactor build and publish workflows
Mqxx 2df8bee
Update publish_jsr.yml
Mqxx e0f10fc
fix: renamed worflow files
Mqxx 33c2765
fix: publish on separate branch
Mqxx af332b7
feat: Also publish jsr.json
Mqxx 59810ec
feat: Refactor
Mqxx f2c0c36
Update build_binary.yml
Mqxx 09d971e
Update build_binary.yml
Mqxx e43bf63
Update build_binary.yml
Mqxx e0c3d52
Update jsr.json.in
Mqxx 25972c3
Update build_binary.yml
Mqxx 4be407f
Update jsr.json.in
Mqxx df84c17
Update build_binary.yml
Mqxx b2d24cf
Update embed_binary.sh
Mqxx ad68ba2
Update embed_binary.sh
Mqxx ac43fe2
Update publish_jsr.yml
Mqxx d002eac
Update embed_binary.sh
Mqxx 6a2c112
fix: use sh instead of txt and source it
Mqxx a089bc0
fix: env
Mqxx a298763
Update publish_jsr.yml
Mqxx 0d82a0d
Update build_binary.yml
Mqxx 59f8213
fix: renamed
Mqxx 3712b9b
Update publish_jsr.yml
Mqxx 2fcc0f6
fix: refactor varaible naming
Mqxx 0e3be99
fix: Permissions
Mqxx 7f3405c
fix: Permissions
Mqxx e4c0e89
feat: Changed version generation
Mqxx 94007b2
Update build_binary.yml
Mqxx 7a543cb
Update build_binary.yml
Mqxx 18611ae
Update build_binary.yml
Mqxx a88b9c2
Update build_binary.yml
Mqxx 0b6ab38
Update build_binary.yml
Mqxx 9c5a34c
Update CMakeLists.txt
Mqxx 2e600e6
Update build_binary.yml
Mqxx dc7575c
Update build_binary.yml
Mqxx c2ea7a8
Update build_binary.yml
Mqxx 796eb21
Update build_binary.yml
Mqxx 48a4cdf
Update CMakeLists.txt
Mqxx 20a1ee7
Update build_binary.yml
Mqxx 57e78a6
Update build_binary.yml
Mqxx 503fe12
Update publish_jsr.yml
Mqxx 27a8407
Update publish_jsr.yml
Mqxx 328b1cf
Update jsr.json
Mqxx d3a1f1b
Update CMakeLists.txt
Mqxx bf4c1a3
feat: Refactor file copy and fixed BINARY_FILE_NAME
Mqxx 20e40ae
fix: added executable flag
Mqxx e1ba112
Update .github/workflows/build_binary.yml
Mqxx 07e56b2
Update .github/workflows/build_binary.yml
Mqxx 159c6de
Update jsr/jsr.json
Mqxx e6724eb
fix: changes from review
Mqxx 7046b40
Update CMakeLists.txt
Mqxx 013586a
Update README.md
Mqxx 532733e
Update README.md
Mqxx 432e6cc
Update build_binary.yml
Mqxx 1028ec9
Update build_binary.yml
Mqxx 4794ca7
Update publish_jsr.yml
Mqxx 7c99ef3
Update README.md
Mqxx 7a5a53a
Update build_binary.yml
Mqxx 4d77426
Update build_binary.yml
Mqxx 6f5e40c
Update build_binary.yml
Mqxx b026f9d
Update build_binary.yml
Mqxx b47c88e
Update build_binary.yml
Mqxx bfccf83
Update build_binary.yml
Mqxx 65d6ff4
Update build_binary.yml
Mqxx 3863380
Update build_binary.yml
Mqxx 6df27b6
Update build_binary.yml
Mqxx c615997
Update build_binary.yml
Mqxx b547908
fix: quotes
Mqxx 125211c
Update build_binary.yml
Mqxx 4a2977e
Update README.md
Mqxx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: 'Build Binary' | ||
| description: | | ||
| This workflow builds the binary files for Linux. The build binaries are stored as artifact | ||
| and may be reused by other workflows. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ 'main' ] | ||
| tags: [ '*' ] | ||
|
|
||
| pull_request: | ||
| branches: [ '*' ] | ||
|
|
||
| jobs: | ||
| build-binary: | ||
| name: 'Build binary' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 'Checkout repository' | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: 'Setup GCC' | ||
| uses: egor-tensin/setup-gcc@v2 | ||
| with: | ||
| version: '14' | ||
| platform: 'x64' | ||
|
|
||
| - name: 'Setup CMake' | ||
| uses: jwlawson/actions-setup-cmake@v2 | ||
| with: | ||
| cmake-version: '3.31.x' | ||
|
|
||
| - name: 'Configure CMake' | ||
| env: | ||
| CXX: g++ | ||
|
|
||
| run: | | ||
| cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release | ||
|
|
||
| - name: 'Build' | ||
| id: 'build' | ||
| run: | | ||
| cmake --build build --config Release | ||
|
|
||
| . build/env.sh | ||
| echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: 'Upload artifacts' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: libcpp_bindings_linux_x86_64 | ||
| path: build/libcpp_bindings_linux.so* | ||
|
|
||
| - name: 'Check tag' | ||
| id: 'check-tag' | ||
| env: | ||
| PACKAGE_VERSION: ${{ steps.build.outputs.PACKAGE_VERSION }} | ||
|
|
||
| run: | | ||
| if [[ "$PACKAGE_VERSION" =~ ^(0|[1-9][[:digit:]]*)\.(0|[1-9][[:digit:]]*)\.(0|[1-9][[:digit:]]*)(-(alpha|rc|beta|experimental)\.[1-9][[:digit:]]*)?$ ]]; then | ||
| echo "Version \"$PACKAGE_VERSION\" is a valid package version." | ||
| echo "IS_VALID_PACKAGE_VERSION=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "Version \"$PACKAGE_VERSION\" is not a valid package version." | ||
| echo "IS_VALID_PACKAGE_VERSION=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| outputs: | ||
| package_version: ${{ steps.build.outputs.PACKAGE_VERSION }} | ||
| is_valid_package_version: ${{ steps.check-tag.outputs.IS_VALID_PACKAGE_VERSION }} | ||
|
|
||
| trigger-publish: | ||
| name: 'Trigger Publish' | ||
| needs: ['build-binary'] | ||
| uses: ./.github/workflows/publish_jsr.yml | ||
| with: | ||
| publish: ${{ needs.build-binary.outputs.is_valid_package_version == 'true' }} | ||
| version: ${{ needs.build-binary.outputs.package_version }} | ||
| artifact-name: libcpp_bindings_linux_x86_64 | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: 'Publish JSR' | ||
| description: | | ||
| This workflow serializes the build binary to Base64 and generates a JSON file with meta data about the file. | ||
| The file then gets published to JSR (@serial/cpp-bindings-linux). | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| publish: | ||
| description: 'Whether to actually publish' | ||
| required: true | ||
| type: boolean | ||
|
|
||
| version: | ||
| description: 'Package version' | ||
| required: true | ||
| type: string | ||
|
|
||
| artifact-name: | ||
| description: 'Name of the artifact' | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| publish-jsr: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: 'Checkout repository' | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: 'Setup Deno' | ||
| uses: denoland/setup-deno@v2 | ||
| with: | ||
| deno-version: '2.x' | ||
|
|
||
| - name: 'Download artifact' | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.artifact-name }} | ||
| path: 'artifacts' | ||
|
|
||
| - name: 'Prepare files for JSR' | ||
| run: | | ||
| ./jsr/scripts/copy_binary.sh \ | ||
| ./artifacts/libcpp_bindings_linux.so \ | ||
| ./jsr/bin/x86_64.so | ||
|
|
||
| ./jsr/scripts/binary_to_json.sh \ | ||
| ./artifacts/libcpp_bindings_linux.so \ | ||
| ./jsr/bin/x86_64.json \ | ||
| linux-x86_64 | ||
|
|
||
| ./jsr/scripts/set_version.sh \ | ||
| jsr/jsr.json \ | ||
| "${{ inputs.version }}" | ||
|
|
||
| - name: 'Publish package to JSR (normal)' | ||
| if: inputs.publish | ||
| working-directory: jsr | ||
| run: | | ||
| deno publish --allow-dirty | ||
|
|
||
| - name: 'Publish package to JSR (dry-run)' | ||
| if: ${{ !inputs.publish }} | ||
| working-directory: jsr | ||
| run: | | ||
| deno publish --allow-dirty --dry-run | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| bin/ | ||
| !src/bin/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.