Release Latest Build #22
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 Latest Build | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout with submodules | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Make shell script executable | |
| run: chmod +x ./build | |
| - name: Run build script | |
| run: ./build | |
| - name: Set release version | |
| run: echo "VERSION=$(date +"%Y.%m.%d.%H%M%S")" >> $GITHUB_ENV | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: latest-release | |
| name: "GraphScript Installer - ${{ env.VERSION }}" | |
| files: | | |
| GSInstallerMac.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: README | |
| run: | | |
| URL="https://github.com/GraphScript-Labs" | |
| DIR="/installer/releases/download/latest-release/" | |
| FILE="GSInstallerMac.zip" | |
| echo "$URL$DIR$FILE" > README.md | |
| - name: Clean up source files | |
| run: | | |
| find . -mindepth 1 -maxdepth 1 ! -name 'README.md' ! -name '.git' -exec rm -rf {} + | |
| - name: Version File | |
| run: | | |
| date +%s > version | |
| - name: Set up Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout --orphan latest-release | |
| - name: Commit and push changes | |
| run: | | |
| git add . | |
| git commit -m "Latest build $(date "+%Y-%m-%d %H:%M:%S")" | |
| git push -f origin latest-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |