Skip to content

Commit

Permalink
Emit Version Information (#445)
Browse files Browse the repository at this point in the history
* Emit Version Information

* Cut new versions in CI on passing master builds
* Emit detailed version information via --version

* add VERSION to gitignore
  • Loading branch information
artemdinaburg committed Aug 7, 2020
1 parent 99df2e1 commit af9b410
Show file tree
Hide file tree
Showing 11 changed files with 531 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ build
remill-build
Dockerfile*
.travis.yml
.git*
.github*
LICENSE
README.md
51 changes: 50 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ on:
# run CI every day even if no PRs/merges occur
- cron: '0 6 * * *'
jobs:
VersionFile:
runs-on: ubuntu-latest
steps:
- name: Bump Version Info For Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest | jq -r '[.tag_name][0] | split(".") as $ver | $ver[-1]|tonumber as $last | $ver[:-1] as $first | $first + [$last+1] | map(tostring) | join(".")' > VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MacOS:
runs-on: macos-latest
needs: [VersionFile]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
Expand Down Expand Up @@ -39,6 +49,7 @@ jobs:
./scripts/travis.sh macos-latest build
Docker_Linux:
runs-on: ubuntu-latest
needs: [VersionFile]
strategy:
matrix:
llvm: ["800", "900", "1000"]
Expand All @@ -52,7 +63,6 @@ jobs:
run: |
docker run --rm docker.pkg.github.com/lifting-bits/remill/llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
docker run --rm docker.pkg.github.com/lifting-bits/remill/llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
- name: Push Image for LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }}
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
Expand All @@ -66,6 +76,18 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Compress Artifacts LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }}
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
mkdir -p artifacts
cp -v scripts/emit-artifact.sh ./artifacts/
docker run -v "$(pwd)/artifacts:/out" --rm docker.pkg.github.com/lifting-bits/remill/llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest -c "/out/emit-artifact.sh /out/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64.tar.xz"
ls -l artifacts/
- uses: actions/upload-artifact@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
name: remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64.tar.xz
path: artifacts/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64.tar.xz
windows:
runs-on: windows-latest
steps:
Expand All @@ -74,3 +96,30 @@ jobs:
continue-on-error: true # for now
run: |
scripts/travis.bat
CreateRelease:
needs: [macOS, Docker_Linux]
runs-on: ubuntu-latest
steps:
- name: Increment Release Version
id: release_ver
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
echo "::set-output name=VERSION::$(<VERSION)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download all artifacts
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: actions/download-artifact@v2
with:
path: releases
- name: Verify Artifact Downloads
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: ls -R
- name: Publish Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release_ver.outputs.VERSION }}
files: releases/*/*.xz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,6 @@ obj-intel64/*

# Lifted binaries
*.lifted

#VERSION files from CI
VERSION
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ list(APPEND PROJECT_DEFINITIONS "REMILL_INSTALL_SEMANTICS_DIR=\"${REMILL_INSTALL
list(APPEND PROJECT_DEFINITIONS "REMILL_BUILD_SEMANTICS_DIR_X86=\"${REMILL_BUILD_SEMANTICS_DIR_X86}\"")
list(APPEND PROJECT_DEFINITIONS "REMILL_BUILD_SEMANTICS_DIR_AARCH64=\"${REMILL_BUILD_SEMANTICS_DIR_AARCH64}\"")

# verion data
add_subdirectory(remill/Version)

add_library(${PROJECT_NAME} STATIC
remill/Arch/AArch64/Arch.cpp
remill/Arch/AArch64/Decode.cpp
Expand All @@ -151,7 +154,7 @@ add_library(${PROJECT_NAME} STATIC
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)

# add everything as public.
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_LIBRARIES} RemillVersion)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR})
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${PROJECT_INCLUDEDIRECTORIES})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_DEFINITIONS} ${GLOBAL_DEFINITIONS})
Expand Down Expand Up @@ -362,6 +365,11 @@ install(FILES
DESTINATION "${install_folder}/include/remill/Arch/AArch64/Runtime"
)

install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/remill/Version/Version.h"
DESTINATION "${install_folder}/include/remill/Version"
)

#
# additional targets
#
Expand Down
Loading

0 comments on commit af9b410

Please sign in to comment.