Skip to content

Commit a32dc72

Browse files
committed
ci: add publish.yml
1 parent 404b7df commit a32dc72

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Publish
3+
4+
on:
5+
push:
6+
tags: ["*"]
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
crates:
13+
name: Publish Rust package
14+
runs-on: ubuntu-latest
15+
container:
16+
image: rust:latest
17+
environment:
18+
name: crates
19+
url: https://crates.io/crates/phpantom_lsp
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v6
23+
- name: Install toml-cli
24+
run: cargo install toml-cli
25+
- name: Check version
26+
run: test "$(toml get -r Cargo.toml package.version)" = "${{ github.ref_name }}"
27+
- name: Publish to crates.io
28+
run: cargo publish
29+
env:
30+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)