12
12
permissions : write-all
13
13
name : Publish
14
14
runs-on : ubuntu-latest
15
+ env :
16
+ ARCHIVE_NAME : jenkins-library-${{ env.PIPER_version }}
15
17
steps :
16
18
- uses : styfle/cancel-workflow-action@0.11.0
17
19
@@ -28,32 +30,35 @@ jobs:
28
30
npm install semver --quiet
29
31
echo "PIPER_version=v$(node_modules/.bin/semver -i minor $(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | jq -r .tag_name))" >> $GITHUB_ENV
30
32
31
- - name : Remove files that should not be published
33
+ - name : Prepare files for archiving
32
34
run : |
33
- rm -f README.md
34
- rm -f CONTRIBUTING.md
35
+ mkdir ${{ github.workspace }}/temp_dir
36
+ rsync -av --exclude={README.md, CONTRIBUTING.md,'*.git*','.github/workflows*'} ./ ${{ github.workspace }}/temp_dir/
35
37
36
38
- name : Create custom release ZIP
37
39
run : |
38
- zip -r jenkins-library-${{ env.PIPER_version }}.zip . -x "*.git*" "*.github/workflows*"
40
+ cd ${{ github.workspace }}/temp_dir
41
+ zip -r ../${{ env.ARCHIVE_NAME }}.zip .
39
42
40
43
- name : Create custom release tar.gz
41
44
run : |
42
- tar -czvf jenkins-library-${{ env.PIPER_version }}.tar.gz --exclude=".git" --exclude=".github/workflows" .
45
+ cd ${{ github.workspace }}/temp_dir
46
+ tar -czvf ../${{ env.ARCHIVE_NAME }}.tar.gz .
43
47
44
- - name : Publish release assets
48
+ - name : Publish custom release ZIP
45
49
uses : actions/upload-release-asset@v1
46
50
with :
47
51
upload_url : ${{ github.event.release.upload_url }}
48
- asset_path : ./jenkins-library- ${{ env.PIPER_version }}.zip
49
- asset_name : jenkins-library- ${{ env.PIPER_version }}.zip
52
+ asset_path : ./${{ env.ARCHIVE_NAME }}.zip
53
+ asset_name : ${{ env.ARCHIVE_NAME }}.zip
50
54
asset_content_type : application/zip
51
55
52
- - uses : actions/upload-release-asset@v1
56
+ - name : Publish custom release tar.gz
57
+ uses : actions/upload-release-asset@v1
53
58
with :
54
59
upload_url : ${{ github.event.release.upload_url }}
55
- asset_path : ./jenkins-library- ${{ env.PIPER_version }}.tar.gz
56
- asset_name : jenkins-library- ${{ env.PIPER_version }}.tar.gz
60
+ asset_path : ./${{ env.ARCHIVE_NAME }}.tar.gz
61
+ asset_name : ${{ env.ARCHIVE_NAME }}.tar.gz
57
62
asset_content_type : application/gzip
58
63
59
64
- uses : SAP/project-piper-action@master
0 commit comments