fix(release): reading version from manifest #5
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: Create Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get version from fxmanifest.lua | |
| id: get_version | |
| shell: bash | |
| run: | | |
| version=$(grep "git_version" fxmanifest.lua | awk -F"'" '{print $2}') | |
| echo "Found version: $version" | |
| if [ ! -z "$version" ]; then | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "Error: Version not found in fxmanifest.lua" | |
| exit 1 | |
| fi | |
| - name: Create ZIP archive | |
| run: | | |
| zip -r sure_lib.zip . -x ".git/*" ".github/*" "*.md" "LICENSE" | |
| - name: Create Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "sure_lib.zip" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| draft: false | |
| prerelease: false | |
| generateReleaseNotes: true | |
| tag: v${{ steps.get_version.outputs.version }} | |
| name: "Release v${{ steps.get_version.outputs.version }}" |