File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release Tagging
2+
3+ on :
4+ push :
5+ branches : [ "v0.2" ]
6+ pull_request :
7+ branches : [ "v0.2" ]
8+
9+ jobs :
10+ release :
11+ runs-on : ubuntu-24.04
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v3
15+ with :
16+ fetch-depth : 0 # Important for git describe --tags
17+
18+ - name : Install Rust
19+ uses : actions-rs/toolchain@v1
20+ with :
21+ toolchain : 1.88.0
22+ components : cargo
23+
24+ - name : Extract Version from Cargo.toml
25+ id : version
26+ run : |
27+ VERSION=$(grep '^version = "' Cargo.toml | sed -E 's/version = "([^"]+)"/\1/')
28+ PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
29+ BRANCH_REF="${GITHUB_REF}"
30+ BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
31+ PROJECT_TAG_RELEASE="v$VERSION-$BRANCH_NAME-$PROJECT_COMMIT_HASH"
32+ echo "::set-output name=project_tag_release::$PROJECT_TAG_RELEASE-961"
33+ echo "Version: $VERSION"
34+ echo "Hash: $PROJECT_COMMIT_HASH"
35+ echo "Branch: $BRANCH_NAME"
36+ echo "Tag Release: $PROJECT_TAG_RELEASE"
37+
38+ - name : Print version
39+ id : print_version
40+ run : |
41+ echo "Printing version"
42+ echo "Version: ${{ steps.version.outputs.project_tag_release }}"
43+
44+ - name : Create GitHub Release
45+ uses : actions/create-release@v1
46+ env :
47+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48+ with :
49+ tag_name : ${{ steps.version.outputs.project_tag_release }}
50+ release_name : Release ${{ steps.version.outputs.project_tag_release }}
51+ body : |
52+ Release of version ${{ steps.version.outputs.project_tag_release }}
You can’t perform that action at this time.
0 commit comments