From 4b6f2216b8829ef94079deb9c0347b6d343d0036 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Thu, 21 Nov 2024 17:11:18 -0500 Subject: [PATCH] WIP --- .github/workflows/release.yml | 90 +++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 7 +-- 2 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ca3457e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,90 @@ +name: Release +on: + push: + branches: [ "release-test" ] + tags: [ '[0-9]+\\.([0-9.])+' ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Build release binary + run: cargo build --release --locked + + - uses: actions/upload-artifact@v4 + with: + name: linux + path: target/release/pbls + + # publish: + # name: Publish + # needs: [build] + # runs-on: ubuntu-latest + # steps: + # - name: Checkout sources + # uses: actions/checkout@v4 + + # - uses: actions/download-artifact@v4 + + # - name: Build archive + # shell: bash + # run: | + # set -ex + + # source="$(pwd)" + # mkdir -p runtime/grammars/sources + # tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources + # rm -rf grammars + + # cd "$(mktemp -d)" + # mv $source/bins-* . + # mkdir dist + + # for dir in bins-* ; do + # platform=${dir#"bins-"} + # if [[ $platform =~ "windows" ]]; then + # exe=".exe" + # fi + # pkgname=helix-$GITHUB_REF_NAME-$platform + # mkdir -p $pkgname + # cp $source/LICENSE $source/README.md $pkgname + # mkdir $pkgname/contrib + # cp -r $source/contrib/completion $pkgname/contrib + # mv bins-$platform/runtime $pkgname/ + # mv bins-$platform/hx$exe $pkgname + # chmod +x $pkgname/hx$exe + + # if [[ "$platform" = "x86_64-linux" ]]; then + # mv bins-$platform/helix-*.AppImage* dist/ + # fi + + # if [ "$exe" = "" ]; then + # tar cJf dist/$pkgname.tar.xz $pkgname + # else + # 7z a -r dist/$pkgname.zip $pkgname + # fi + # done + + # tar cJf dist/helix-$GITHUB_REF_NAME-source.tar.xz -C $source . + # mv dist $source/ + + # - name: Upload binaries to release + # uses: svenstaro/upload-release-action@v2 + # if: env.preview == 'false' + # with: + # repo_token: ${{ secrets.GITHUB_TOKEN }} + # file: dist/* + # file_glob: true + # tag: ${{ github.ref_name }} + # overwrite: true + + # - name: Upload binaries as artifact + # uses: actions/upload-artifact@v4 + # if: env.preview == 'true' + # with: + # name: release + # path: dist/* + diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d94b948..f74fd19 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,14 +11,15 @@ env: jobs: build: - runs-on: ubuntu-latest env: RUST_LOG: pbls=trace + RUST_BACKTRACE: 1 steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - name: Build run: cargo build --verbose - name: Install protoc @@ -26,5 +27,5 @@ jobs: curl https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protoc-28.2-linux-x86_64.zip -Lo /tmp/protoc.zip unzip /tmp/protoc.zip bin/protoc --version - - name: Run tests + - name: Test run: PATH="$PATH:bin/" cargo test --verbose