-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (69 loc) · 2.89 KB
/
Copy pathbindist-thin.yml
File metadata and controls
78 lines (69 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Create a binary distribution (thin)
on:
workflow_call:
inputs:
release-version:
required: true
type: string
upload-url:
required: true
type: string
jobs:
dist:
name: Binary distribution (thin)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: filenames
name: Archive names
run: |
echo "diktat-cli-tar=diktat-cli-${{ inputs.release-version }}.tar" >>"${GITHUB_OUTPUT}"
echo "diktat-cli-tgz=diktat-cli-${{ inputs.release-version }}.tar.gz" >>"${GITHUB_OUTPUT}"
echo "diktat-cli-zip=diktat-cli-${{ inputs.release-version }}.zip" >>"${GITHUB_OUTPUT}"
shell: bash
- name: Archive
run: |
tar cf '${{ steps.filenames.outputs.diktat-cli-tar }}' --exclude-backups --exclude-vcs --exclude-vcs-ignore --exclude='*.bat' --exclude='*.cmd' -C bin diktat
gzip -9 '${{ steps.filenames.outputs.diktat-cli-tar }}'
zip -jrX9 -Z bzip2 '${{ steps.filenames.outputs.diktat-cli-zip }}' bin
shell: bash
# Upload a .tar.gz artifact, except when this is a release.
- name: Upload ${{ steps.filenames.outputs.diktat-cli-tgz }}
if: ${{ github.ref_type == 'branch' }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.filenames.outputs.diktat-cli-tgz }}
path: ${{ steps.filenames.outputs.diktat-cli-tgz }}
if-no-files-found: error
retention-days: 1
# Upload a .zip artifact, except when this is a release.
- name: Upload ${{ steps.filenames.outputs.diktat-cli-zip }}
if: ${{ github.ref_type == 'branch' }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.filenames.outputs.diktat-cli-zip }}
path: ${{ steps.filenames.outputs.diktat-cli-zip }}
if-no-files-found: error
retention-days: 1
- name: Upload release asset (${{ steps.filenames.outputs.diktat-cli-tgz }})
id: upload-release-asset-tgz
if: ${{ github.ref_type == 'tag' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ inputs.upload-url }}
asset_path: ${{ steps.filenames.outputs.diktat-cli-tgz }}
asset_name: ${{ steps.filenames.outputs.diktat-cli-tgz }}
asset_content_type: application/gzip
- name: Upload release asset (${{ steps.filenames.outputs.diktat-cli-zip }})
id: upload-release-asset-zip
if: ${{ github.ref_type == 'tag' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ inputs.upload-url }}
asset_path: ${{ steps.filenames.outputs.diktat-cli-zip }}
asset_name: ${{ steps.filenames.outputs.diktat-cli-zip }}
asset_content_type: application/zip