Skip to content

Commit

Permalink
chore: initial publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev committed Sep 19, 2024
1 parent e79572c commit 73cf8ff
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
Empty file removed .github/workflows/deploy.yml
Empty file.
107 changes: 107 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Deploy CLI

on:
push:
branches:
- main

# on:
# push:
# tags:
# - v*

jobs:
bundle-cli:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x64, arm64]
env:
BUNDLE_FILENAME: localsandbox-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: npm ci

- name: Bundle CLI
run: npm run bundle:cli

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: localsandbox-${{ matrix.os }}-${{ matrix.arch }}
path: ${{ env.BUNDLE_FILENAME }}

smoke-test:
needs: bundle-cli
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: localsandbox-${{ matrix.os }}-${{ matrix.arch }}
path: ./

# Add your smoke test steps here

create-release:
needs: [bundle-cli, smoke-test]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

# - name: Generate Changelog
# id: changelog
# run: |
# echo "## Changelog" > changelog.md
# echo "" >> changelog.md
# git log -1 --pretty=format:"%s" >> changelog.md

- name: Create a Release
uses: elgohr/Github-Release-Action@v5
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: MyReleaseMessage
tag: MyTag

# - name: Create GitHub Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ env.VERSION }}
# release_name: Release ${{ env.VERSION }}
# draft: false
# prerelease: false
# body_path: changelog.md

# - name: Upload Release Assets
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./localsandbox-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
# asset_name: localsandbox-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
# asset_content_type: application/gzip

0 comments on commit 73cf8ff

Please sign in to comment.