Skip to content

fix(ci): use latest build artifact in release #2

fix(ci): use latest build artifact in release

fix(ci): use latest build artifact in release #2

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get latest successful build run-id
id: get_run_id
run: |
latest_run_id=$(gh api repos/${{ github.repository }}/actions/workflows/build.yml/runs \
-q '.workflow_runs | map(select(.conclusion == "success")) | first | .id')
echo "run_id=$latest_run_id" >> $GITHUB_ENV
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: dist
run-id: ${{ env.run_id }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/dispenser-schedule-card.min.js
asset_name: dispenser-schedule-card.min.js
asset_content_type: application/javascript