name: Build and Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
call-build:
uses: ./.github/workflows/reusable_build.yml
release:
needs: call-build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: List downloaded artifacts
run: ls -l ./artifacts
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
body: ""
draft: false
prerelease: false
- name: Install GitHub CLI
run: sudo apt-get install -y gh
- name: Authenticate GitHub CLI
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Upload all artifacts to Release
run: |
for artifact in ./artifacts/**/*.zip; do
if [[ -f "$artifact" ]]; then
echo "Uploading $artifact..."
gh release upload ${{ github.ref_name }} "$artifact" --clobber
fi
done