From 984d0faa78ba3a2e2437ec79d74ed55ce83984df Mon Sep 17 00:00:00 2001 From: Andy Pack Date: Sun, 28 Jul 2024 14:39:58 +0100 Subject: [PATCH] adding cargo publish --- .gitea/workflows/test.yml | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 885ad98..b36e90c 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -56,6 +56,48 @@ jobs: run: cargo build working-directory: ./draught + publishLib: + runs-on: ubuntu-latest + name: Package Library + needs: [ build-web ] # for ignoring bad builds + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + github-server-url: https://gitea.sheep-ghoul.ts.net + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Add SarGit Repo + run: | + cat < ~/.cargo/config.toml + [registry] + default = "sargit" + + [registries.sargit] + index = "sparse+https://git.sarsoo.xyz/api/packages/${{ secrets.DOCKERHUB_USERNAME }}/cargo/" + + [net] + git-fetch-with-cli = true + EOF + + - name: Add SarGit Credentials + run: | + cat < ~/.cargo/credentials.toml + [registries.sargit] + token = "Bearer ${{ secrets.DOCKERHUB_TOKEN }}" + EOF + + - name: Cargo Publish + uses: actions-rs/cargo@v1 + with: + command: publish + args: --package draughtlib + package: runs-on: ubuntu-latest name: Package Container