Skip to content

Commit 64dd1be

Browse files
Enable releasing via GitHub Actions
1 parent f663d34 commit 64dd1be

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Create a new release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- run: |
16+
echo "RELEASE_VERSION=${GITHUB_REF#'refs/tags/v'}" >>"${GITHUB_ENV}"
17+
shell: bash
18+
19+
- run: |
20+
tar cf 'diktat-cli-${{ env.RELEASE_VERSION }}.tar' -C bin diktat
21+
gzip -9 'diktat-cli-${{ env.RELEASE_VERSION }}.tar'
22+
shell: bash
23+
24+
- id: create_release
25+
uses: actions/create-release@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
with:
29+
tag_name: ${{ github.ref }}
30+
release_name: v${{ env.RELEASE_VERSION }}
31+
draft: false
32+
prerelease: false
33+
34+
- id: upload-release-asset
35+
uses: actions/upload-release-asset@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
upload_url: ${{ steps.create_release.outputs.upload_url }}
40+
asset_path: diktat-cli-${{ env.RELEASE_VERSION }}.tar.gz
41+
asset_name: diktat-cli-${{ env.RELEASE_VERSION }}.tar.gz
42+
asset_content_type: application/gzip

0 commit comments

Comments
 (0)