refactor: rename zima-cron to cron per Icewhale branding #1
Workflow file for this run
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 RAW | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Run tests | |
| run: go test ./... | |
| - name: Build backend (linux amd64) | |
| run: | | |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ | |
| -ldflags="-s -w" \ | |
| -o ./raw/usr/bin/cron \ | |
| ./cmd/cron | |
| chmod +x ./raw/usr/bin/cron | |
| - name: Sync frontend files | |
| run: | | |
| cp app.js raw/usr/share/casaos/www/modules/cron/app.js | |
| cp index.html raw/usr/share/casaos/www/modules/cron/index.html | |
| cp styles.css raw/usr/share/casaos/www/modules/cron/styles.css | |
| - name: Install squashfs-tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y squashfs-tools | |
| - name: Package RAW | |
| run: | | |
| mksquashfs raw/ cron.raw -noappend -comp gzip | |
| ls -lh cron.raw | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cron.raw | |
| path: cron.raw | |
| - name: Get version (push/dispatch) | |
| id: get_version_push | |
| if: ${{ github.event_name != 'release' }} | |
| run: | | |
| echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
| - name: Get version (release) | |
| id: get_version_release | |
| if: ${{ github.event_name == 'release' }} | |
| run: | | |
| echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT | |
| - name: Update release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ./cron.raw | |
| tag_name: ${{ steps.get_version_push.outputs.VERSION || steps.get_version_release.outputs.VERSION }} |