set default os based paths for config and logs #12
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: Build and Release | |
| permissions: | |
| contents: write | |
| packages: write | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| name: Build binaries | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: [linux, windows] | |
| arch: [amd64] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "1.24.0" | |
| - name: Install dependencies | |
| run: go mod tidy | |
| - name: Build | |
| env: | |
| GOOS: ${{ matrix.os }} | |
| GOARCH: ${{ matrix.arch }} | |
| run: | | |
| BINARY="devmind-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}" | |
| if [ "${{ matrix.os }}" = "windows" ]; then | |
| BINARY="$BINARY.exe" | |
| fi | |
| go build -o $BINARY . | |
| - name: Upload binaries | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: devmind-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }} | |
| path: devmind-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}* | |
| release: | |
| name: Create GitHub Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download Linux binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: devmind-${{ github.ref_name }}-linux-amd64 | |
| - name: Download Windows binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: devmind-${{ github.ref_name }}-windows-amd64 | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| release_name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload Linux asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: devmind-${{ github.ref_name }}-linux-amd64 | |
| asset_name: devmind-${{ github.ref_name }}-linux-amd64 | |
| asset_content_type: application/octet-stream | |
| - name: Upload Windows asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: devmind-${{ github.ref_name }}-windows-amd64.exe | |
| asset_name: devmind-${{ github.ref_name }}-windows-amd64.exe | |
| asset_content_type: application/octet-stream |