Skip to content

Commit 50a2d02

Browse files
Remove README and CONTRIBUTING files from release 3rd try (#5226)
1 parent 38f9e5b commit 50a2d02

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

.github/workflows/release-go.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
permissions: write-all
1313
name: Publish
1414
runs-on: ubuntu-latest
15+
env:
16+
ARCHIVE_NAME: jenkins-library-${{ env.PIPER_version }}
1517
steps:
1618
- uses: styfle/cancel-workflow-action@0.11.0
1719

@@ -28,32 +30,35 @@ jobs:
2830
npm install semver --quiet
2931
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
3032
31-
- name: Remove files that should not be published
33+
- name: Prepare files for archiving
3234
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/
3537
3638
- name: Create custom release ZIP
3739
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 .
3942
4043
- name: Create custom release tar.gz
4144
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 .
4347
44-
- name: Publish release assets
48+
- name: Publish custom release ZIP
4549
uses: actions/upload-release-asset@v1
4650
with:
4751
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
5054
asset_content_type: application/zip
5155

52-
- uses: actions/upload-release-asset@v1
56+
- name: Publish custom release tar.gz
57+
uses: actions/upload-release-asset@v1
5358
with:
5459
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
5762
asset_content_type: application/gzip
5863

5964
- uses: SAP/project-piper-action@master

0 commit comments

Comments
 (0)