Skip to content

Commit

Permalink
βž• [GitHub Workflows] Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sech1p committed Jun 8, 2024
1 parent 87a817c commit 02cf8c1
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
push:
tags:
- '*'

env:
node: true
es6: true

jobs:
release_job_linux:
runs-on: ubuntu-latest
name: πŸ’Ύ Releasing
steps:
- name: βœ” Checkout
uses: actions/checkout@v4

- name: πŸ’» Download node and release package
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm install --save-dev
- run: npm run build
- run: npm install -g @yao-pkg
- run: pkg dist/index.js

- name: πŸ›  Draft Release
id: draft_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ✨ ${{ github.ref }}
draft: false

- name: πŸ›  Build Release (Linux)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
asset_path: ./index-linux
asset_name: blahaj-linux-x64
asset_content_type: application/x-elf

- name: πŸ›  Build Release (Windows)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
asset_path: ./index-win.exe
asset_name: blahaj-win-x64.exe
asset_content_type: application/vnd.microsoft.portable-executable

- name: πŸ›  Build Release (macOS)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
asset_path: ./index-macos
asset_name: blahaj-macos-x64
asset_content_type: application/x-mach-binary


0 comments on commit 02cf8c1

Please sign in to comment.