Skip to content

Update 03-update-assets.yml #17

Update 03-update-assets.yml

Update 03-update-assets.yml #17

on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
#tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Upload Release Asset
jobs:
build:
name: Upload Release Asset for ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
os: [windows-latest]
build_type: [Release]
steps:
- name: Checkout self
uses: actions/checkout@v4
- name: Download pre-packed asset
uses: actions/download-artifact@v4
with:
# name: ProMesh4-Installer-${{matrix.os}}
name: ProMesh4-Installer-windows-latest
# path: $GITHUB_WORKSPACE
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: 11026224064
- name: Download pre-packed artifact
run: ls .
#- name: Download pre-packed artifact
# run: ls ./assets
# Fetch the latest release from GitHub API
- name: Get latest release
id: get_release
run: |
latest_release=$(curl -s \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases/latest)
echo "::set-output name=upload_url::$(echo $latest_release | jq -r .upload_url | sed -e "s/{?name,label}//")"
- name: Test
run: echo "URL=${{ steps.get_release.outputs.upload_url }}"
- name: Upload Release Binary
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ProMesh4-Installer.exe
asset_name: ProMesh4-Installer-win64.exe
asset_content_type: application/octet-stream