From 724c727f85e3ec63c9a2c9290fb62d2a1415976c Mon Sep 17 00:00:00 2001 From: Gavin Hayes Date: Tue, 24 Oct 2023 16:04:00 -0400 Subject: [PATCH] feat: ci builds --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4025a87 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: CI +on: + pull_request: + workflow_dispatch: + push: + tags: + - 'v*.*.*' + +jobs: + build-binaries: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Setup cosmocc + run: | + sudo mkdir -p /opt + sudo chmod 1777 /opt + git clone https://github.com/jart/cosmopolitan.git /opt/cosmo + export PATH="/opt/cosmo/bin:/opt/cosmos/bin:$PATH" + echo 'PATH="/opt/cosmo/bin:/opt/cosmos/bin:$PATH"' >>~/.profile + ape-install + cosmocc --update + - name: Verify cosmocc installed properly + run: cosmocc --version + - name: Install deps + run: | + cd dockerfile-parser-rs/third-party/pest + cargo build --package pest_bootstrap + - name: Build APEs + run: | + ./build_hermit.sh + - name: upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: hermit + path: | + build/hermit.com + build/cat.hermit.com + build/count_vowels.hermit.com + build/cowsay.hermit.com + + create-release: + name: Create release + runs-on: ubuntu-latest + permissions: + contents: write + needs: [ build-binaries ] + steps: + - name: Fetch build artifacts + if: ${{ github.ref_type == 'tag' }} + uses: actions/download-artifact@v3 + - name: Publish release + if: ${{ github.ref_type == 'tag' }} + uses: softprops/action-gh-release@v1 + with: + fail_on_unmatched_files: true + files: | + hermit/hermit.com + hermit/cat.hermit.com + hermit/count_vowels.hermit.com + hermit/cowsay.hermit.com