name: Create Release on: push: tags: - 'v*.*' # Triggers on version tags like v1.0 jobs: release: runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout code uses: actions/checkout@v4 - name: Get version from tag id: get_version run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - name: Get version without dots id: version_no_dots run: echo "VERSION_NO_DOTS=$(echo '${{ steps.get_version.outputs.VERSION }}' | tr -d '.')" >> $GITHUB_OUTPUT - name: Get tag message id: tag_message run: | git fetch --depth=1 origin +refs/tags/*:refs/tags/* echo "MESSAGE<> $GITHUB_OUTPUT git tag -l --format='%(contents)' ${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: Create release directory run: mkdir -p release_temp/godot-screenshots-${{ steps.version_no_dots.outputs.VERSION_NO_DOTS }}/addons/screenshots - name: Copy plugin files run: | cp -r addons/screenshots/* release_temp/godot-screenshots-${{ steps.version_no_dots.outputs.VERSION_NO_DOTS }}/addons/screenshots/ cp LICENSE.md release_temp/godot-screenshots-${{ steps.version_no_dots.outputs.VERSION_NO_DOTS }}/addons/screenshots/ - name: Create ZIP archive run: | cd release_temp zip -r ../godot-screenshots-${{ steps.get_version.outputs.VERSION }}.zip godot-screenshots-${{ steps.version_no_dots.outputs.VERSION_NO_DOTS }} cd .. - name: Create Release uses: softprops/action-gh-release@v1 with: files: godot-screenshots-${{ steps.get_version.outputs.VERSION }}.zip body: ${{ steps.tag_message.outputs.MESSAGE }} draft: false prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}