Skip to content

Commit

Permalink
Fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
jkfran committed Mar 17, 2023
1 parent 0b1e46f commit 3348750
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Release

permissions:
contents: write

on:
push:
branches:
Expand All @@ -24,19 +27,12 @@ jobs:
- name: Build deb package
run: cargo deb

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x

- name: Install toml CLI
run: pip install toml-cli

- name: Get version from Cargo.toml
- name: Extract version from Cargo.toml
id: get_version
run: |
VERSION=$(toml get Cargo.toml package.version | tr -d '"')
VERSION=$(grep '^version =' Cargo.toml | head -n 1 | awk '{print $3}' | tr -d '"' | tr -d "\n")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Found version: $VERSION"
echo "::set-output name=version::$VERSION"
- name: Check if release exists
Expand All @@ -45,7 +41,7 @@ jobs:
with:
script: |
const { owner, repo } = context.repo;
const version = "${{ steps.get_version.outputs.version }}";
const version = "${{ env.VERSION }}";
const tag = `v${version}`;
let releaseExists = false;
Expand All @@ -68,8 +64,8 @@ jobs:
if: ${{ !steps.check_release.outputs.releaseExists }}
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
files: target/debian/killport_${{ steps.get_version.outputs.version }}_amd64.deb
tag_name: v${{ env.VERSION }}
name: Release v${{ env.VERSION }}
files: target/debian/killport_${{ env.VERSION }}_amd64.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 3348750

Please sign in to comment.