-
Notifications
You must be signed in to change notification settings - Fork 43
add release automation #13
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| name: Release | ||
| on: workflow_dispatch | ||
| jobs: | ||
| create-release: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| release_id: ${{ steps.create.outputs.id }} | ||
| release_url: ${{ steps.create.outputs.upload_url }} | ||
| steps: | ||
| - name: create release | ||
| id: create | ||
| uses: actions/create-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: latest | ||
| release_name: latest | ||
| draft: true | ||
| prerelease: false | ||
| build: | ||
| needs: create-release | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| platform: ["amd64", "arm64/v8"] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - name: Setup QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: build docker environment | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| platforms: linux/${{ matrix.platform }} | ||
| push: false | ||
| tags: instrew-env | ||
| - name: build instrew | ||
| run: docker run --rm -v "$PWD"/:/instrew/ instrew-env | ||
| - name: generate artifact name | ||
| uses: mad9000/actions-find-and-replace-string@5 | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above how this might not be needed, but anyway I'd like to keep things rather simple/dumb, i.e. prefer a few shell commands over dependencies from some random people. |
||
| id: artifact-name | ||
| with: | ||
| source: instrew-${{ matrix.platform }}.tar.gz | ||
| find: '/' | ||
| replace: '' | ||
| - name: bundle instrew | ||
| run: mv install instrew && tar -czf ${{ steps.artifact-name.outputs.value }} instrew | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But.. only a single file ( |
||
| - name: upload release | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ needs.create-release.outputs.release_url }} | ||
| asset_path: ./${{ steps.artifact-name.outputs.value }} | ||
| asset_name: ${{ steps.artifact-name.outputs.value }} | ||
| asset_content_type: application/gzip | ||
| publish-release: | ||
| needs: | ||
| - create-release | ||
| - build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: delete-previous-release | ||
| uses: dev-drprasad/delete-older-releases@v0.2.0 | ||
| with: | ||
| keep_latest: 0 | ||
| delete_tags: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: publish release | ||
| uses: eregon/publish-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| release_id: ${{ needs.create-release.outputs.release_id }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| /*.sublime-* | ||
| /build* | ||
| /build/* | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, this breaks my workflow. I have multiple build folders for different LLVM versions, compilers, and debug/release. 😅 |
||
| /install | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # build this docker image for a clean environemnt to build instrew | ||
| FROM ubuntu:24.04 | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debian > Ubuntu. I'd rather build on an older distribution (e.g. Debian stable)? |
||
|
|
||
| # install dependencies | ||
| RUN apt update \ | ||
| && apt install -y gnupg wget meson cmake pkg-config libssl-dev clang | ||
|
|
||
| # install LLVM | ||
| RUN wget --no-check-certificate -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -\ | ||
| && echo 'deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-17 main' >> /etc/apt/sources.list \ | ||
| && apt update \ | ||
| && apt install -y llvm-17 \ | ||
| && update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-17 17 | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use LLVM from standard repositories -- I don't see a benefit of not doing so. Simple is better. |
||
|
|
||
| # create mount point for project | ||
| RUN mkdir /instrew/ | ||
|
|
||
| # build and test project | ||
| WORKDIR /instrew/ | ||
| CMD /instrew/build.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,11 +9,13 @@ Instrew is a performance-targeted transparent dynamic binary translator(/instrum | |
| After cloning and checking out submodules, compile Instrew as follows: | ||
|
|
||
| ``` | ||
| mkdir build | ||
| meson build -Dbuildtype=release | ||
| ninja -C build | ||
| # optionally, run tests | ||
| ninja -C build test | ||
| ./build.sh | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, no. I'm not going down the |
||
| ``` | ||
|
|
||
| If your build has dependency issues, consider using the provided dockerfile | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. I'm not using containers that much, so I'm not likely to catch breakage... I'd probably prefer to explicitly list dependencies here rather than referencing some Dockerfile I'm not going to use myself. |
||
| ``` | ||
| docker build . --tag instrew-env # run once | ||
| docker run --rm -v "$PWD"/:/instrew instrew-env # run to build instrew | ||
| ``` | ||
|
|
||
| Afterwards, you can run an application with Instrew. Statically linked applications often have a significantly lower translation time. New glibc versions often tend to use recent syscalls that are not yet supported, therefore warnings about missing system calls can sometimes be ignored. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mkdir -p build | ||
| meson build -Dprefix="$PWD"/install -Dbuildtype=release | ||
| ninja -C build | ||
| ninja -C build test | ||
| ninja -C build install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't
"arm64"suffice?