[fcelib][Python] rewrite version check, reduce fluff, refactor api #63
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: release_scripts | |
| on: | |
| [push, pull_request, workflow_dispatch] | |
| env: | |
| DEST: fcecodec | |
| jobs: | |
| linux: | |
| runs-on: ubuntu-latest | |
| name: Ubuntu | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # with: | |
| # repository: "bfut/fcecodec" | |
| - name: Get the version | |
| run: | | |
| export FCEC_VERS=$(grep "FCECVERS" 'src/fcelib/fcelib.h' | sed -n "s/^.*FCECVERS \"\s*\(\S*\)\".*$/\1/p") | |
| echo "${FCEC_VERS}" | |
| export FCEC_VERS_NODOT="${FCEC_VERS//./}" | |
| echo "${FCEC_VERS_NODOT}" | |
| echo "version=${FCEC_VERS_NODOT}" >> "$GITHUB_ENV" | |
| - name: Create archive (fcecodec_scripts) | |
| run: | | |
| echo "${version}" ${{ env.version }} | |
| git clone https://github.com/bfut/PyScripts utils/bfut_PyScripts | |
| rm -rf utils/bfut_PyScripts/.git | |
| 7z a -tzip "${{ env.DEST }}${{ env.version }}_scripts.zip" \ | |
| utils/bfut_PyScripts/* \ | |
| scripts/* \ | |
| tests/fce/Snowman_car.fce \ | |
| tests/fce/Snowman_README.txt \ | |
| python/README.md \ | |
| README.md | |
| ls -lg | |
| # Uploading zip artifact to Github Actions creates a nested zip at this time. Hence... | |
| # Extract archive to folder, subsequently upload folder as artifact | |
| 7z x -y "${{ env.DEST }}${{ env.version }}_scripts.zip" -o"${{ env.DEST }}${{ env.version }}_scripts" | |
| - name: Store archive (fcecodec_scripts) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "${{ env.DEST }}${{ env.version }}_scripts" | |
| path: "${{ env.DEST }}${{ env.version }}_scripts" | |
| compression-level: 9 | |
| retention-days: 7 |