Skip to content

Commit f0c576c

Browse files
authored
replace deprecated upload github action (#115)
* replace deprecated upload github action * specify version in worflow dispatch * permissions write
1 parent d44b604 commit f0c576c

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

.github/workflows/create-artifacts.yml

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Zip and Publish Subfolders
22
on:
33
release:
44
types: [published]
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'Version tag for the artifacts'
9+
required: true
10+
type: string
511
jobs:
612
zip-and-publish:
713
runs-on: ubuntu-latest
@@ -32,44 +38,29 @@ jobs:
3238
upload-artifacts:
3339
needs: zip-and-publish
3440
runs-on: ubuntu-latest
35-
strategy:
36-
matrix:
37-
file: ${{ fromJson(needs.zip-and-publish.outputs.files) }}
41+
permissions:
42+
contents: write
3843
steps:
3944
- name: Download zip files
4045
uses: actions/download-artifact@v4
4146
with:
4247
name: zip-files
43-
- name: Debug output (file existence check)
44-
run: |
45-
if [ -e "${{ matrix.file }}" ]; then
46-
echo "File '${{ matrix.file }}' exists."
47-
else
48-
echo "File '${{ matrix.file }}' does not exist."
49-
fi
50-
shell: bash
51-
- name: Upload artifact
52-
uses: actions/upload-release-asset@v1
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
48+
- name: Upload release assets
49+
uses: softprops/action-gh-release@v2
5550
with:
56-
upload_url: ${{ github.event.release.upload_url }}
57-
asset_path: ./${{ matrix.file }}
58-
asset_name: ${{ matrix.file }}
59-
asset_content_type: application/zip
51+
files: "*.zip"
52+
tag_name: ${{ github.event.inputs.version || github.ref_name }}
6053

6154
upload-templates-json:
6255
needs: upload-artifacts
6356
runs-on: ubuntu-latest
57+
permissions:
58+
contents: write
6459
steps:
6560
- name: Checkout repository
6661
uses: actions/checkout@v2
6762
- name: Upload templates.json as release asset
68-
uses: actions/upload-release-asset@v1
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
63+
uses: softprops/action-gh-release@v2
7164
with:
72-
upload_url: ${{ github.event.release.upload_url }}
73-
asset_path: ./templates.json
74-
asset_name: templates.json
75-
asset_content_type: application/json
65+
files: templates.json
66+
tag_name: ${{ github.event.inputs.version || github.ref_name }}

0 commit comments

Comments
 (0)