From 8e2d34ca431ccc833f6887e0c251931354732439 Mon Sep 17 00:00:00 2001 From: Ken Gorab Date: Mon, 21 Oct 2024 19:38:43 -0400 Subject: [PATCH] Adding release workflow --- .github/workflows/release.yml | 73 +++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 2 +- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..9e4cff30 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Cache Cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Cache LLVM + id: cache-llvm + uses: actions/cache@v3 + with: + path: ./llvm + key: llvm-11.1.0 + - name: Cache QBE + id: cache-qbe + uses: actions/cache@v3 + with: + path: ./qbe/qbe-1.2 + key: qbe-1.2 + - name: Install LLVM (11.1.0) + run: | + mkdir -p llvm + curl -L "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-20.10.tar.xz" > llvm.tar.xz + tar x --xz -C llvm --strip-components=1 -f llvm.tar.xz + if: steps.cache-llvm.outputs.cache-hit != 'true' + - name: Setup LLVM + run: | + sudo apt-get update + sudo apt-get install -y libtinfo6 + echo "PATH=$(pwd)/llvm/bin:$PATH" >> $GITHUB_ENV + echo "LLVM_CONFIG=$(pwd)/llvm/bin/llvm-config" >> $GITHUB_ENV + - name: Install QBE + run: | + mkdir -p qbe + cd qbe + wget https://c9x.me/compile/release/qbe-1.2.tar.xz + tar -xf qbe-1.2.tar.xz + cd qbe-1.2 + make + if: steps.cache-qbe.outputs.cache-hit != 'true' + - name: Setup QBE + run: | + ls -la ./qbe + ls -la ./qbe/qbe-1.2 + echo "PATH=$(pwd)/qbe/qbe-1.2:$PATH" >> $GITHUB_ENV + - name: Build reference compiler + run: cargo build + - name: Install ext dependencies + run: ./configure-libgc.sh + - name: Build selfhosted compiler + run: | + cd selfhost + ./abra build -o compiler ./src/compiler.test.abra + cp ./._abra/compiler "./abra-${{ github.ref_name }}-linux" + - name: Release + uses: softprops/action-gh-release@v2 + with: + files: + "selfhost/abra-${{ github.ref_name }}-linux" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 02062954..e6cc8a60 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -69,7 +69,7 @@ jobs: echo "PATH=$(pwd)/qbe/qbe-1.2:$PATH" >> $GITHUB_ENV - name: Build rust run: cargo build - - name: Install ext dependencies (for C compilation) + - name: Install ext dependencies run: ./configure-libgc.sh - name: Run rust tests run: TEST_TMP_DIR=${{ runner.temp }} cargo test --verbose