Getting the tag name of release
Opened this issue · 2 comments
mertyildiran commented
I have this workflow:
name: Publish the Debian Package
on:
release:
types: [published]
jobs:
publish-deb-package:
name: Build and publish the Debian package
runs-on: ubuntu-latest
container:
image: docker://dragoncomputer/dragonfire:latest
steps:
- uses: actions/checkout@v1
- name: Cache pip packages
uses: actions/cache@v1
with:
path: /root/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip3 install -e .
- name: Generate the Debian package
run: |
dpkg-buildpackage -us -uc
cd ..
echo ${{ github.ref }} | cut -c12- | { read version; }
- name: Upload to release
uses: JasonEtco/upload-to-release@master
with:
args: dragonfire_${version}_amd64.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
With echo ${{ github.ref }} | cut -c12- | { read version; }
I aim to get 1.0.7
from refs/tags/v1.0.7
(which is the output of the value of github.ref
) but passing to args:
seems impossible. dragonfire_${version}_amd64.deb
resolves into dragonfire_${version}_amd64.deb
while either dragonfire_1.0.7_amd64.deb
or dragonfire__amd64.deb
expected.
How can I achieve what I'm trying to achieve here?
Andre601 commented
Try using ${{ github.event.release.tag_name }}
I use that for my workflow without issues.
mertyildiran commented