aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/publish.yml
blob: 0e26bb7847840f61eafeb0846a9556bbb3e8aa98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: publish
on:
  workflow_dispatch: # We can add version input when 1.0 is released and scheduled releases are removed

  schedule:
    - cron: "0 0 * * *" # midnight UTC

  push:
    branches:
      - release

jobs:
  publish:
    name: publish
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Install Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          profile: minimal
          override: true

      - name: Install cargo-workspaces
        uses: actions-rs/[email protected]
        with:
          crate: cargo-workspaces

      - name: Release
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          PATCH: ${{ github.run_number }}
        shell: bash
        run: |
          git config --global user.email "[email protected]"
          git config --global user.name "Github Action"
          rm Cargo.lock
          cargo workspaces rename ra_ap_%n
          find crates/rust-analyzer -type f -name '*.rs' -exec sed -i 's/rust_analyzer/ra_ap_rust_analyzer/g' {} +
          cargo workspaces publish --yes --force '*' --exact --no-git-commit --allow-dirty --skip-published custom 0.0.$PATCH