Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xiwenc committed Sep 16, 2024
1 parent bd5cf06 commit 3875432
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
release:
types: [created]

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.x"

- name: Display dotnet version
run: dotnet --version

- name: Compile
run: make

- name: Zip rules directory
run: |
mkdir MxLintExtension
cp bin/Debug/net8.0/* MxLintExtension
zip -r extension.zip MxLintExtension
- name: Get current tag version
run: |
echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "upload_url=${{ github.event.release.upload_url }}" >> $GITHUB_OUTPUT
id: get_release

- name: Upload Release Asset (ZIP)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./extension.zip
asset_name: MxLintExtension-${{ steps.get_release.outputs.tag_name}}.zip
asset_content_type: application/zip


0 comments on commit 3875432

Please sign in to comment.