M1 Releases (#46) #202
This file contains 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
name: CI | |
on: | |
pull_request: | |
branches: | |
- "*" | |
push: | |
branches: | |
- "main" | |
tags: | |
- "btighidra-v*" | |
jobs: | |
build-native: | |
name: Build Natives ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- target: linux_x86_64 | |
os: ubuntu-22.04 | |
arch: amd64 | |
- target: mac_x86_64 | |
os: macos-13 | |
arch: amd64 | |
- target: mac_arm_64 | |
os: macos-14 | |
arch: arm64 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/setup-prereqs | |
with: | |
bti_secret: ${{ secrets.SUB_BTI }} | |
cwe_secret: ${{ secrets.SUB_CWE_CHECKER }} | |
- name: Run native bins | |
run: | | |
just install-native | |
- name: Tar the binaries | |
run: tar -cvf "${{matrix.target}}.build.tar" $(find . -path "*/plugin/os/${{ matrix.target }}/*" -type f) | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: natives-${{ matrix.target }} | |
path: "${{matrix.target}}.build.tar" | |
retention-days: 1 | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/setup-prereqs | |
with: | |
bti_secret: ${{ secrets.SUB_BTI }} | |
cwe_secret: ${{ secrets.SUB_CWE_CHECKER }} | |
- name: "Lint, Build, and Test BTI" | |
run: | | |
just test | |
- name: "Tar logs" | |
if: ${{ failure() }} | |
run: | | |
tar -cvf test-report.tar.gz plugin/build/reports/tests/ | |
- name: "Upload test logs" | |
uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: Test Report | |
path: test-report.tar.gz | |
release: | |
runs-on: ubuntu-22.04 | |
needs: [build-native, test] | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/setup-prereqs | |
with: | |
bti_secret: ${{ secrets.SUB_BTI }} | |
cwe_secret: ${{ secrets.SUB_CWE_CHECKER }} | |
arch_override: ${{ matrix.arch }} | |
- name: Download linux_x86_64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: natives-linux_x86_64 | |
- name: Download mac_x86_64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: natives-mac_x86_64 | |
- name: Download mac_arm_64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: natives-mac_arm_64 | |
- name: Extract all binaries | |
run: | | |
for file in *.build.tar; do | |
echo "Extracting $file" | |
tar xvf "$file" | |
done | |
- name: "Build release" | |
run: | | |
just build | |
- name: Upload multiplatform build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: btighidra | |
path: "plugin/dist/*" | |
retention-days: 7 | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/btighidra-v') | |
with: | |
files: "plugin/dist/*" |