Skip to content

Commit

Permalink
ci: add release step
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed Feb 15, 2025
1 parent 273c84f commit e3fa0a6
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ on:
push:
branches:
- master
tags:
- v*
pull_request:

jobs:
package:
runs-on: ubuntu-latest
env:
SUFFIX: ${{ github.ref_type == 'tag' && github.ref_name || github.base_ref || github.sha }}

steps:
- uses: actions/checkout@v4
Expand All @@ -28,12 +32,20 @@ jobs:
cd ~
zip -X -r logto-plugin.zip logto/ -x "*/node_modules/*" ".*" "*/.*" composer.* README.md renovate.json
cd -
mv ~/logto-plugin.zip .
mv ~/logto-plugin.zip ./logto-plugin-${{ env.SUFFIX }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: logto-plugin
path: logto-plugin.zip
name: logto-plugin-${{ env.SUFFIX }}
path: logto-plugin-${{ env.SUFFIX }}.zip
retention-days: 1
if-no-files-found: error

- name: Create release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
draft: true
append_body: true
files: logto-plugin-${{ env.SUFFIX }}.zip

0 comments on commit e3fa0a6

Please sign in to comment.