-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (34 loc) · 1.49 KB
/
deploy_prerelease.yml
File metadata and controls
34 lines (34 loc) · 1.49 KB
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
name: Publish pre-release
on:
push:
branches: [main]
jobs:
github:
name: Publish GitHub
environment: GITHUB_PRE_RELEASE
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Rust toolchain for ubuntu-latest
uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48
- name: Package
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505
with:
command: package
args: --all-features
- name: Read crate name
id: crate_name
run: echo "crate_name=$(cargo read-manifest | jq -r .name)" >> $GITHUB_OUTPUT
- name: Read version
id: version
run: echo "version=$(cargo read-manifest | jq -r .version)" >> $GITHUB_OUTPUT
- name: Read git commit hash
id: commit_hash
run: echo "commit_hash=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions
run: gh release create "${{ steps.commit_hash.outputs.commit_hash }}" --repo="$GITHUB_REPOSITORY" --target main --title="Pre-Release ${{ steps.commit_hash.outputs.commit_hash }} (${{ steps.version.outputs.version }})" --generate-notes --prerelease "./target/package/${{ steps.crate_name.outputs.crate_name }}-${{ steps.version.outputs.version }}.crate"