]> git.lizzy.rs Git - rust.git/blob - .github/workflows/publish.yml
Remove deprecate action
[rust.git] / .github / workflows / publish.yml
1 name: publish
2 on:
3   workflow_dispatch: # We can add version input when 1.0 is released and scheduled releases are removed
4
5 #   schedule:
6 #     - cron: "0 0 * * *" # midnight UTC
7
8   push:
9     branches:
10       - release
11
12 jobs:
13   publish:
14     name: publish
15     runs-on: ubuntu-latest
16     steps:
17       - name: Checkout repository
18         uses: actions/checkout@v3
19         with:
20           fetch-depth: 0
21
22       - name: Install Rust toolchain
23         run: rustup update stable
24
25       - name: Install cargo-workspaces
26         run: cargo install cargo-workspaces
27
28       - name: Release
29         env:
30           CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
31           PATCH: ${{ github.run_number }}
32         shell: bash
33         run: |
34           git config --global user.email "runner@gha.local"
35           git config --global user.name "Github Action"
36           rm Cargo.lock
37           cargo workspaces rename ra_ap_%n
38           find crates/rust-analyzer -type f -name '*.rs' -exec sed -i 's/rust_analyzer/ra_ap_rust_analyzer/g' {} +
39           # Fix names for crates that were published before switch to kebab-case.
40           find crates -name 'Cargo.toml' -exec sed -i "s/ra_ap_base-db/ra_ap_base_db/g; s/ra_ap_hir-def/ra_ap_hir_def/g; s/ra_ap_hir-expand/ra_ap_hir_expand/g; s/ra_ap_hir-ty/ra_ap_hir_ty/g; s/ra_ap_ide-assists/ra_ap_ide_assists/g; s/ra_ap_ide-completion/ra_ap_ide_completion/g; s/ra_ap_ide-db/ra_ap_ide_db/g; s/ra_ap_ide-diagnostics/ra_ap_ide_diagnostics/g; s/ra_ap_ide-ssr/ra_ap_ide_ssr/g; s/ra_ap_proc-macro-api/ra_ap_proc_macro_api/g; s/ra_ap_proc-macro-srv/ra_ap_proc_macro_srv/g; s/ra_ap_project-model/ra_ap_project_model/g; s/ra_ap_test-utils/ra_ap_test_utils/g; s/ra_ap_text-edit/ra_ap_text_edit/g" {} +
41           cargo workspaces publish --yes --force '*' --exact --no-git-commit --allow-dirty --skip-published custom 0.0.$PATCH