Skip to content

Commit

Permalink
Add action to relase files to Github.
Browse files Browse the repository at this point in the history
  • Loading branch information
zgypa committed Mar 27, 2024
1 parent cbc9d92 commit b52dc28
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy to GitHub Releases

on:
push:
branches:
- main # or any branch you prefer

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

# Add any build steps here if necessary

- name: Run Build
run: make build # Assumes you have a Makefile with a 'build' target

- 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: false
prerelease: false

- name: Upload Release Assets
run: |
for filename in dist/*; do
echo "Uploading ${filename}"
asset_path=${filename}
asset_name=$(basename ${filename})
asset_url=$(curl -s -X POST -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/octet-stream" --data-binary @"${asset_path}" "${{ steps.create_release.outputs.upload_url }}?name=${asset_name}" | jq -r .browser_download_url)
echo "Uploaded ${asset_name} to ${asset_url}"
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b52dc28

Please sign in to comment.