From 2b110af8456dda049b5f2e947c96f6643acb9674 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Thu, 19 Mar 2026 14:59:31 -0400 Subject: [PATCH] Add publish workflow --- .forgejo/workflows/publish.yml | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .forgejo/workflows/publish.yml diff --git a/.forgejo/workflows/publish.yml b/.forgejo/workflows/publish.yml new file mode 100644 index 0000000..5bf46a0 --- /dev/null +++ b/.forgejo/workflows/publish.yml @@ -0,0 +1,67 @@ +name: Publish Cargo Package + +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + publish: + runs-on: docker + env: + CARGO_TERM_COLOR: always + CARGO_REGISTRIES_FORGEJO_TOKEN: Bearer ${{ secrets.FORGEJO_CARGO_TOKEN }} + FORGEJO_CARGO_INDEX: ${{ github.server_url }}/${{ github.repository_owner }}/_cargo-index.git + steps: + - name: Check out repository + uses: https://data.forgejo.org/actions/checkout@v4 + + - name: Install Rust + run: | + if ! command -v cargo >/dev/null 2>&1; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal + fi + + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + . "$HOME/.cargo/env" + rustup toolchain install stable --profile minimal + rustup default stable + cargo --version + + - name: Configure Cargo registry + run: | + mkdir -p "$HOME/.cargo" + cat > "$HOME/.cargo/config.toml" <