feat: refacto app init, add integration test #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 | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| release: | |
| types: [ created ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build and Release | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-version: ['1.25.x'] | |
| node-version: ['18.x'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Go ${{ matrix.go-version }} | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| cache: true | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: 'ui/pnpm-lock.yaml' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: latest | |
| run_install: false | |
| - name: Get Go dependencies | |
| run: go mod download | |
| - name: Install UI dependencies | |
| run: | | |
| cd ui | |
| pnpm install | |
| - name: Build UI | |
| run: | | |
| cd ui | |
| pnpm run build | |
| - name: Test application | |
| run: | | |
| go test ./... | |
| - name: Build application for multiple architectures | |
| run: | | |
| export GOARCH=arm64 | |
| go build -o sortir.linux-arm64 cmd/main.go | |
| go build -o populate.linux-arm64 cmd/populate/populate.go | |
| export GOARCH=amd64 | |
| go build -o sortir.linux-amd64 cmd/main.go | |
| go build -o populate.linux-amd64 cmd/populate/populate.go | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries | |
| path: | | |
| sortir.linux-arm64 | |
| sortir.linux-amd64 | |
| populate.linux-arm64 | |
| populate.linux-amd64 | |
| retention-days: 3 | |
| - name: Create release for tagged commits | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| sortir.linux-arm64 | |
| sortir.linux-amd64 | |
| populate.linux-arm64 | |
| populate.linux-amd64 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create/Update latest release | |
| if: github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: Latest Build | |
| tag_name: latest | |
| files: | | |
| sortir.linux-arm64 | |
| sortir.linux-amd64 | |
| populate.linux-arm64 | |
| populate.linux-amd64 | |
| prerelease: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Clean up old releases | |
| uses: dev-drprasad/delete-older-releases@v0.3.2 | |
| with: | |
| keep_latest: 5 | |
| delete_tags: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |