diff options
author | Tom Milligan <tom.milligan@uipath.com> | 2023-05-05 09:13:57 +0100 |
---|---|---|
committer | Tom Milligan <tom.milligan@uipath.com> | 2023-05-05 09:16:28 +0100 |
commit | 1e0a3992d5e9b79bd7b793f9350c64496946d6f9 (patch) | |
tree | 3a059ac9338e31a02bbaae4b3ed05bdc84b8a4be | |
parent | d97747d1952510586754952ec3b6e74fd8935e21 (diff) |
ci: fix automatic crates.io publicationci-publish-auto
-rw-r--r-- | .github/workflows/deploy.yml | 34 | ||||
-rw-r--r-- | .github/workflows/publish.yml | 31 |
2 files changed, 33 insertions, 32 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a8fda38..4052fd2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -109,9 +109,14 @@ jobs: - name: Setup | Artifacts uses: actions/download-artifact@v3 + - name: Setup | Extract version + shell: bash + run: echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/tags/v})" + id: extract_version + - name: Setup | Release notes run: | - git log -1 --pretty='%s' > RELEASE.md + cat CHANGELOG.md | sed -n '/^## ${{ steps.extract_version.outputs.version }}$/,/^## /p' | sed '$d' > RELEASE.md - name: Build | Publish uses: softprops/action-gh-release@v1 with: @@ -119,3 +124,30 @@ jobs: body_path: RELEASE.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Upload to crates.io + publish: + name: Publish to crates.io + needs: github_release + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + ~/.cargo/bin + cargo_target + # We reuse the cache from our detailed test environment, if available + key: detailed-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Publish crate + env: + CARGO_LOGIN_TOKEN: ${{ secrets.CARGO_LOGIN_TOKEN }} + run: ./scripts/publish diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 4af82e7..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: publish - -on: - release: - types: [published] - workflow_dispatch: - -jobs: - publish: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - ~/.cargo/bin - cargo_target - # We reuse the cache from our detailed test environment, if available - key: detailed-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} - - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Publish crate - env: - CARGO_LOGIN_TOKEN: ${{ secrets.CARGO_LOGIN_TOKEN }} - run: ./scripts/publish |