Merge pull request #979 from obgnail/dev #12
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PublishOnTag | |
| on: | |
| push: | |
| tags: | |
| - '[0-9]+\.[0-9]+\.[0-9]+' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get Latest Tag | |
| id: get_latest_tag | |
| run: | | |
| TAG=$(git describe --tags --abbrev=0) | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| echo "Latest Tag: $TAG" | |
| - name: Package Plugin | |
| id: package_plugin | |
| run: | | |
| PLUGIN_NAME="typora-plugin" | |
| VERSION_JSON="plugin/bin/version.json" | |
| PLUGIN_VERSION="${{ steps.get_latest_tag.outputs.tag }}" | |
| ZIP_NAME="${PLUGIN_NAME}@v${PLUGIN_VERSION}.zip" | |
| echo "Creating $VERSION_JSON" | |
| echo "{ \"tag_name\": \"${PLUGIN_VERSION}\", \"name\": \"${PLUGIN_VERSION}\" }" > $VERSION_JSON | |
| echo "Creating zip archive: $ZIP_NAME" | |
| zip -r "$ZIP_NAME" plugin/ | |
| echo "zip_name=$ZIP_NAME" >> $GITHUB_OUTPUT | |
| echo "Zip file created: $ZIP_NAME" | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: ${{ steps.package_plugin.outputs.zip_name }} |