Fix CI once and for all
@@ -13,14 +13,12 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
- if: github.event.type != 'PullRequestEvent' || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release'))
+ if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release'))
steps:
- name: Checkout sources
uses: actions/checkout@v3
- - run: echo ${{ github.event.type }}
-
- name: Install libusb and libftdi (linux)
run: |
sudo apt update
@@ -51,17 +49,22 @@ jobs:
git config --global user.signingkey "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGr8+OZiQ6EHlhZcsPbnbkiW0wBtgNYGR2J5SI+QOw9Q bot@probe.rs"
- name: Generate Release Notes
- id: notes
run: |
cargo xtask generate-release-changelog > /tmp/GENERATED_CHANGELOG.md
+ - name: Extract crate version
+ id: crate_version
+ run: |
+ VERSION=$(cargo pkgid -p probe-rs | cut -d# -f2 | cut -d: -f2)
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
+
- name: Create a GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
- tag_name: "$( cargo pkgid -p probe-rs | cut -d# -f2 | cut -d: -f2 )"
- release_name: "$( cargo pkgid -p probe-rs | cut -d# -f2 | cut -d: -f2 )"
+ tag_name: ${{ steps.crate_version.outputs.version }}
+ release_name: ${{ steps.crate_version.outputs.version }}
body_path: /tmp/GENERATED_CHANGELOG.md
draft: true
prerelease: false
@@ -70,6 +73,6 @@ jobs:
run: |
git checkout master
cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
- cargo release --no-confirm --execute --sign $( cargo pkgid -p probe-rs | cut -d# -f2 | cut -d: -f2 )
+ cargo release --no-confirm --execute --sign ${{ steps.crate_version.outputs.version }}
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
