Skip to content

Commit 0399aa2

Browse files
author
Vladimir Kotal
committed
get bare tag name
1 parent bf78b55 commit 0399aa2

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@ on:
77
- '[1-9]+.[0-9]+.[0-9]+'
88

99
jobs:
10+
get_tag:
11+
name: Get tag name
12+
outputs:
13+
tag: ${{ steps.get_tag.outputs.tag }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout master branch
17+
uses: actions/checkout@v2
18+
- name: Get the tag name
19+
id: get_tag
20+
env:
21+
OPENGROK_REF: ${{ github.ref }}
22+
run: ./dev/ref2tag.sh
1023
build:
1124
runs-on: ubuntu-latest
25+
needs: get_tag
1226
steps:
1327
- name: Checkout master branch
1428
uses: actions/checkout@v2
@@ -35,7 +49,7 @@ jobs:
3549
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3650
with:
3751
tag_name: ${{ github.ref }}
38-
release_name: Release ${{ github.ref }}
52+
release_name: ${{ github.ref }}
3953
draft: false
4054
prerelease: false
4155
- name: Upload release tarball
@@ -45,6 +59,6 @@ jobs:
4559
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4660
with:
4761
upload_url: ${{ steps.create_release.outputs.upload_url }}
48-
asset_path: ./distribution/target/opengrok-${{ github.ref }}.tar.gz
62+
asset_path: ./distribution/target/opengrok-${{ needs.get_tag.outputs.tag }}.tar.gz
4963
asset_name: opengrok-${{ github.ref }}.tar.gz
5064
asset_content_type: application/octet-stream

dev/ref2tag.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
tag=${OPENGROK_REF#"refs/tags/"}
4+
echo "::set-output name=tag::$tag"

0 commit comments

Comments
 (0)