Skip to content

vfox-clang 0.1.0

vfox-clang 0.1.0 #2

name: Publish for Release
on:
release:
types: [published]
jobs:
Publish:
name: Publish for Release
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Download source
uses: actions/checkout@v4
- name: Generate file name
id: get_name
run: |
TAG_NAME=${{ github.event.release.tag_name }}
VERSION=${TAG_NAME#v}
FILE_NAME="${GITHUB_REPOSITORY##*/}_$VERSION.zip"
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "FILE_NAME=$FILE_NAME" >> $GITHUB_OUTPUT
echo "PLUGIN=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT
- uses: edgarrc/action-7z@v1
with:
args: 7z a -tzip -mx=9 -xr!*.git* -xr!.* ${{ steps.get_name.outputs.FILE_NAME }}
- name: Publish to Releases
uses: ncipollo/release-action@v1
with:
name: "${{ steps.get_name.outputs.PLUGIN }} ${{ github.event.release.tag_name }}"
allowUpdates: true
artifacts: ${{ steps.get_name.outputs.FILE_NAME }}
artifactErrorsFailBuild: false
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitPrereleaseDuringUpdate: true
- name: Update manifest
run: |
curl -L -o manifest.json https://github.com/$GITHUB_REPOSITORY/releases/download/manifest/manifest.json
echo "$(jq --arg target "https://github.com/$GITHUB_REPOSITORY/releases/download/${{ github.event.release.tag_name }}/${{ steps.get_name.outputs.FILE_NAME }}" \
--arg version "${{ steps.get_name.outputs.VERSION }}" \
'.downloadUrl = $target | .version = $version' manifest.json)" > manifest.json
- name: Publish manifest
uses: ncipollo/release-action@v1
with:
name: "manifest"
tag: "manifest"
allowUpdates: true
artifacts: "manifest.json"
artifactErrorsFailBuild: false
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitPrereleaseDuringUpdate: true