diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index a82eccf3..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: CI -on: - push: - branches: - - master - pull_request: - schedule: - # run CI every day even if no PRs/merges occur - - cron: '0 6 * * *' -jobs: - VersionFile: - runs-on: ubuntu-latest - outputs: - version: ${{ steps.bump.outputs.VERSION }} - steps: - - id: bump - name: Bump Version Info For Release - 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 - echo "::set-output name=VERSION::$( VERSION - ./scripts/travis.sh macos-latest initialize - ./scripts/travis.sh macos-latest build - Docker_Linux: - runs-on: ubuntu-latest - needs: [VersionFile] - strategy: - matrix: - llvm: ["900", "1000", "1100"] - ubuntu: ["20.04", "18.04"] - steps: - - uses: actions/checkout@v2 - - name: Build LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }} - run: | - echo ${{needs.VersionFile.outputs.version}} > VERSION - docker build . -t docker.pkg.github.com/lifting-bits/remill/llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest -f Dockerfile --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --build-arg ARCH=amd64 --build-arg LLVM_VERSION=${{ matrix.llvm }} - - name: Test Remill with LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }} - 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: | - docker login docker.pkg.github.com -u "${GH_USER}" -p "${GH_TOKEN}" - for i in 1 2 3; do docker push docker.pkg.github.com/lifting-bits/remill/llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest && break || sleep 10; done - docker login -u "${DOCKER_HUB_USER}" -p "${DOCKER_HUB_TOKEN}" - docker tag docker.pkg.github.com/lifting-bits/remill/llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest trailofbits/remill:llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64 - docker push trailofbits/remill:llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64 - env: - GH_USER: ${{ github.actor }} - 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 --entrypoint /bin/bash 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: - needs: [VersionFile] - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Run Tests - continue-on-error: true # for now - run: | - echo ${{needs.VersionFile.outputs.version}} > VERSION - scripts/travis.bat - CreateRelease: - needs: [macOS, Docker_Linux, VersionFile] - runs-on: ubuntu-latest - steps: - - 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: ${{ needs.VersionFile.outputs.version }} - files: releases/*/*.xz - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/vcpkg_ci.yml b/.github/workflows/vcpkg_ci.yml index 3fd947c1..5b998a68 100644 --- a/.github/workflows/vcpkg_ci.yml +++ b/.github/workflows/vcpkg_ci.yml @@ -88,7 +88,7 @@ jobs: fail-fast: false matrix: os: [ - 'macos-11.0' + 'macos-10.15' ] llvm: [ '11' @@ -126,5 +126,106 @@ jobs: - name: Store the TGZ package uses: actions/upload-artifact@v1 with: - name: macos-11.0_llvm${{ matrix.llvm }}_tgz_package - path: ${{ steps.package_names.outputs.TGZ_PACKAGE_PATH }} \ No newline at end of file + name: ${{ matrix.os }}_llvm${{ matrix.llvm }}_tgz_package + path: ${{ steps.package_names.outputs.TGZ_PACKAGE_PATH }} + + + + + release_linux: + # Do not run the release procedure if any of the builds has failed + needs: [ build_linux, build_mac ] + runs-on: ubuntu-20.04 + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v2 + + - name: Draft the new release + id: create_release + uses: actions/create-release@v1 + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + with: + tag_name: ${{ github.ref }} + release_name: Version ${{ github.ref }} + draft: true + prerelease: true + + - name: Group the packages by platform + run: | + zip -r9 remill_ubuntu-18.04_packages.zip \ + ubuntu-18.04* + + zip -r9 remill_ubuntu-20.04_packages.zip \ + ubuntu-20.04* + + - name: Upload the Ubuntu 18.04 packages + uses: actions/upload-release-asset@v1 + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: remill_ubuntu-18.04_packages.zip + asset_name: remill_ubuntu-18.04_packages.zip + asset_content_type: application/gzip + + - name: Upload the Ubuntu 20.04 packages + uses: actions/upload-release-asset@v1 + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: remill_ubuntu-20.04_packages.zip + asset_name: remill_ubuntu-20.04_packages.zip + asset_content_type: application/gzip + + + + + release_macos: + # Do not run the release procedure if any of the builds has failed + needs: [ build_linux, build_mac ] + runs-on: 'macos-10.15' + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v2 + + - name: Draft the new release + id: create_release + uses: actions/create-release@v1 + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + with: + tag_name: ${{ github.ref }} + release_name: Version ${{ github.ref }} + draft: true + prerelease: true + + - name: Group the packages by platform + run: | + zip -r9 remill_macos-10.15_packages.zip \ + macos-10.15* + + - name: Upload the macOS 10.15 packages + uses: actions/upload-release-asset@v1 + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: remill_macos-10.15_packages.zip + asset_name: remill_macos-10.15_packages.zip + asset_content_type: application/gzip diff --git a/scripts/build.sh b/scripts/build.sh index 4dfab3c6..86f260a5 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -27,6 +27,7 @@ LLVM_VERSION=llvm-9 OS_VERSION= ARCH_VERSION= BUILD_FLAGS= +CXX_COMMON_VERSION="v0.1.1" # There are pre-build versions of various libraries for specific # Ubuntu releases. @@ -100,7 +101,7 @@ function GetArchVersion function DownloadVcpkgLibraries { local GITHUB_LIBS="${LIBRARY_VERSION}.tar.xz" - local URL="https://github.com/trailofbits/cxx-common/releases/latest/download/${GITHUB_LIBS}" + local URL="https://github.com/trailofbits/cxx-common/releases/download/${CXX_COMMON_VERSION}/${GITHUB_LIBS}" mkdir -p "${DOWNLOAD_DIR}" pushd "${DOWNLOAD_DIR}" || return 1