Skip to content

Commit

Permalink
Get release version from Cargo toml (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
ostenbom authored Nov 8, 2023
1 parent 95320b4 commit 9562f30
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Create Release

on:
workflow_dispatch:
inputs:
tag:
description: "Tag to use for the new release"
required: true
push:
branches:
- main
paths:
- "linkup-cli/Cargo.toml"

jobs:
publish-to-github:
Expand Down Expand Up @@ -58,6 +58,12 @@ jobs:
- name: Build
run: cargo build --release --manifest-path linkup-cli/Cargo.toml --target ${{ matrix.target }}

- name: Get Version from Cargo.toml
id: get_version
run: |
VERSION=$(grep '^version = ' linkup-cli/Cargo.toml | sed -E 's/version = "(.*)"/\1/')
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Package Artifacts
run: |
src=$(pwd)
Expand All @@ -74,7 +80,8 @@ jobs:
cp target/${{ matrix.target }}/release/linkup $stage/
cd $stage
RELEASE_VERSION=${{ github.event.inputs.tag }}
# Use the version from the environment variable
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
ASSET_NAME="linkup-$RELEASE_VERSION-${{ matrix.target }}.tar.gz"
ASSET_PATH="$src/$ASSET_NAME"
CHECKSUM_PATH="$ASSET_PATH.sha256"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion linkup-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "linkup-cli"
version = "0.1.0"
version = "0.1.14"
edition = "2021"

[[bin]]
Expand Down

0 comments on commit 9562f30

Please sign in to comment.