debug release #50
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build: | |
uses: ./.github/workflows/ci.yml | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: List artifact contents | |
run: | | |
echo "Listing artifacts directory:" | |
ls -R artifacts | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "Installing gh CLI..." | |
curl -L https://github.com/cli/cli/releases/download/v2.17.0/gh_2.17.0_linux_amd64.tar.gz | \ | |
tar xvz --strip-components=2 --exclude=man | |
chmod +x ./gh | |
mkdir tars | |
mv ./artifacts/*/*.tar.gz tars/ || mv ./artifacts/*.tar.gz tars/ || echo "No .tar.gz files found" | |
if [ "$(ls -A tars)" ]; then | |
./gh release create --repo "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" ./tars/* || \ | |
./gh release upload --repo "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" ./tars/* | |
else | |
echo "No files to release. Exiting." | |
exit 1 | |
fi |