Skip to content

Commit

Permalink
test: fix pipline
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzhuyule committed Aug 21, 2024
1 parent b94650b commit 69630c4
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ name: Build and Release

on:
push:
branches:
- action
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
required: true
default: 'v0.0.1'

jobs:
build-and-release:
Expand All @@ -23,12 +22,12 @@ jobs:
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
Expand All @@ -39,18 +38,32 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Build project
run: pnpm build

- name: Zip sink-tool folder
run: zip -r sink-tool.zip sink-tool

- name: Get tag name
id: get_tag_name
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- 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 }}
body: Release ${{ github.ref }}
draft: false
prerelease: false

- uses: ncipollo/release-action@v1
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
artifacts: "sink-tool.zip"

upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sink-tool.zip
asset_name: sink-tool.zip
asset_content_type: application/zip

0 comments on commit 69630c4

Please sign in to comment.