Skip to content

Commit

Permalink
ci: add release action
Browse files Browse the repository at this point in the history
Signed-off-by: Urban Vidovič <[email protected]>
  • Loading branch information
pseudobun committed Aug 13, 2024
1 parent f911484 commit 49362da
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Release

on:
push:
branches:
- main
tags:
- 'v*.*.*'

jobs:
build:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14.15'

- name: Run grunt
run: npx grunt

- name: Zip files
run: zip -r release.zip .

- name: Create GitHub 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
uses: ncipollo/[email protected]
with:
artifacts: "release.zip"
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 49362da

Please sign in to comment.