fix: handle Codex CLI commandExecution item type for command cards #4
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 | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Release tag, e.g. v0.1.0" | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: linux | |
| goarch: amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| - goos: darwin | |
| goarch: amd64 | |
| - goos: darwin | |
| goarch: arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Resolve tag | |
| id: tag | |
| run: | | |
| set -euo pipefail | |
| if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then | |
| TAG="${{ github.event.inputs.tag }}" | |
| else | |
| TAG="${GITHUB_REF_NAME}" | |
| fi | |
| if [[ -z "${TAG}" ]]; then | |
| echo "tag is empty" >&2 | |
| exit 1 | |
| fi | |
| echo "tag=${TAG}" >> "${GITHUB_OUTPUT}" | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build binary | |
| env: | |
| CGO_ENABLED: "0" | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: | | |
| set -euo pipefail | |
| mkdir -p dist | |
| OUT="dist/codewithphone" | |
| go build -trimpath -ldflags="-s -w" -o "${OUT}" ./cmd/codewithphone | |
| TAR="dist/codewithphone_${{ steps.tag.outputs.tag }}_${{ matrix.goos }}_${{ matrix.goarch }}.tar.gz" | |
| tar -C dist -czf "${TAR}" codewithphone | |
| rm -f "${OUT}" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: dist/*.tar.gz | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Resolve tag | |
| id: tag | |
| run: | | |
| set -euo pipefail | |
| if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then | |
| TAG="${{ github.event.inputs.tag }}" | |
| else | |
| TAG="${GITHUB_REF_NAME}" | |
| fi | |
| echo "tag=${TAG}" >> "${GITHUB_OUTPUT}" | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Flatten artifacts and generate checksums | |
| run: | | |
| set -euo pipefail | |
| mkdir -p release | |
| find dist -type f -name "*.tar.gz" -exec mv {} release/ \; | |
| (cd release && sha256sum *.tar.gz > checksums.txt) | |
| ls -la release | |
| - name: Create or update release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| generate_release_notes: true | |
| files: | | |
| release/*.tar.gz | |
| release/checksums.txt |