2023-01-25 08:02:52 -06:00
|
|
|
name: autopublish
|
2020-06-06 14:50:28 -05:00
|
|
|
on:
|
|
|
|
workflow_dispatch: # We can add version input when 1.0 is released and scheduled releases are removed
|
|
|
|
|
2022-09-27 11:22:06 -05:00
|
|
|
# schedule:
|
|
|
|
# - cron: "0 0 * * *" # midnight UTC
|
2020-06-06 14:50:28 -05:00
|
|
|
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
name: publish
|
2020-08-25 05:45:06 -05:00
|
|
|
runs-on: ubuntu-latest
|
2020-06-06 14:50:28 -05:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-04-30 15:56:03 -05:00
|
|
|
uses: actions/checkout@v3
|
2020-06-06 14:50:28 -05:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Install Rust toolchain
|
2022-07-16 05:42:28 -05:00
|
|
|
run: rustup update --no-self-update stable
|
2020-06-06 14:50:28 -05:00
|
|
|
|
|
|
|
- name: Install cargo-workspaces
|
2022-07-14 14:24:38 -05:00
|
|
|
run: cargo install cargo-workspaces
|
2020-06-06 14:50:28 -05:00
|
|
|
|
2023-01-25 08:02:52 -06:00
|
|
|
- name: Publish Crates
|
2020-06-06 14:50:28 -05:00
|
|
|
env:
|
|
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
|
|
PATCH: ${{ github.run_number }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
git config --global user.email "runner@gha.local"
|
2023-04-13 17:35:00 -05:00
|
|
|
git config --global user.name "GitHub Action"
|
2020-06-06 14:50:28 -05:00
|
|
|
rm Cargo.lock
|
2022-07-28 10:21:14 -05:00
|
|
|
# Fix names for crates that were published before switch to kebab-case.
|
|
|
|
cargo workspaces rename --from base-db base_db
|
|
|
|
cargo workspaces rename --from hir-def hir_def
|
|
|
|
cargo workspaces rename --from hir-expand hir_expand
|
|
|
|
cargo workspaces rename --from hir-ty hir_ty
|
|
|
|
cargo workspaces rename --from ide-assists ide_assists
|
|
|
|
cargo workspaces rename --from ide-completion ide_completion
|
|
|
|
cargo workspaces rename --from ide-db ide_db
|
|
|
|
cargo workspaces rename --from ide-diagnostics ide_diagnostics
|
|
|
|
cargo workspaces rename --from ide-ssr ide_ssr
|
|
|
|
cargo workspaces rename --from proc-macro-api proc_macro_api
|
|
|
|
cargo workspaces rename --from proc-macro-srv proc_macro_srv
|
|
|
|
cargo workspaces rename --from project-model project_model
|
|
|
|
cargo workspaces rename --from test-utils test_utils
|
|
|
|
cargo workspaces rename --from text-edit text_edit
|
2020-06-06 14:50:28 -05:00
|
|
|
cargo workspaces rename ra_ap_%n
|
2022-09-27 11:22:06 -05:00
|
|
|
# Remove library crates from the workspaces so we don't auto-publish them as well
|
|
|
|
sed -i 's/ "lib\/\*",//' ./Cargo.toml
|
2020-08-25 05:45:06 -05:00
|
|
|
find crates/rust-analyzer -type f -name '*.rs' -exec sed -i 's/rust_analyzer/ra_ap_rust_analyzer/g' {} +
|
2020-06-06 14:50:28 -05:00
|
|
|
cargo workspaces publish --yes --force '*' --exact --no-git-commit --allow-dirty --skip-published custom 0.0.$PATCH
|