fork/rust-sdks

git clone https://git.julia.blue/fork/rust-sdks

Daisuke MuraseFix publish workflow (#550)ca39260

main
1.6 KiB57 linesraw
1# Copyright 2023 LiveKit, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15name: Bump and publish crates
16
17on:
18  workflow_dispatch:
19    inputs:
20      packages:
21        description: "packages to bump"
22        type: string
23        required: true
24
25env:
26  CARGO_TERM_COLOR: always
27  CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
28
29jobs:
30  bump:
31    permissions:
32      contents: write
33    runs-on: ubuntu-latest
34    steps:
35      - uses: actions/checkout@v3
36        with:
37          ssh-key: ${{ secrets.NANPA_KEY }}
38      - uses: nbsp/ilo@v1
39        with:
40          packages: ${{ github.event.inputs.packages }}
41  publish:
42    runs-on: ubuntu-latest
43    needs: bump
44    steps:
45      - uses: actions/checkout@v3
46        with:
47          submodules: true
48      - name: Resync is needed after bump
49        run: |
50          git fetch --tags && git checkout origin/main
51      - name: Publish crates
52        run: |
53          git tag --points-at HEAD |
54          sed 's|^[^/]*@|@|' |
55          sed 's|^[^/]*/||' |
56          sed 's|@.*||' |
57          xargs -I _ sh -c 'cd ./_ && cargo publish --no-verify'