Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 12 additions & 26 deletions .github/workflows/opencode-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,26 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262

- name: Resolve plugin version
id: version
env:
DIST_TAG: ${{ inputs.tag }}
run: |
VERSION=$(npm view opencode-synced@${{ inputs.tag }} version)
case "$DIST_TAG" in
latest|next) ;;
*) echo "Unsupported npm dist-tag"; exit 1 ;;
esac
VERSION=$(npm view "@tsunamik/opencode-synced@$DIST_TAG" version)
if [ -z "$VERSION" ]; then
echo "No version found for tag: ${{ inputs.tag }}"
echo "No version found for requested tag"
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Install opencode
env:
opencode_install_dir: ${{ runner.temp }}/opencode/bin
run: |
curl -fsSL https://opencode.ai/install | bash
echo "${opencode_install_dir}" >> "$GITHUB_PATH"
run: npm install --global opencode-ai@1.18.15

- name: Configure clean opencode home
env:
Expand All @@ -65,23 +67,7 @@ jobs:
cat > "$XDG_CONFIG_HOME/opencode/opencode.json" <<EOF
{
"\$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-synced@${PLUGIN_VERSION}"]
}
EOF

SYNC_REPO="$XDG_DATA_HOME/opencode-synced/repo"
mkdir -p "$SYNC_REPO"
git -C "$SYNC_REPO" init -q

cat > "$XDG_CONFIG_HOME/opencode/opencode-synced.jsonc" <<EOF
{
"repo": {
"owner": "smoke",
"name": "opencode-config",
},
"localRepoPath": "$SYNC_REPO",
"includeSecrets": false,
"extraSecretPaths": [],
"plugin": ["@tsunamik/opencode-synced@${PLUGIN_VERSION}"]
}
EOF

Expand Down Expand Up @@ -155,7 +141,7 @@ jobs:

- name: Upload opencode logs (on failure)
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: opencode-smoke-logs-${{ matrix.os }}
path: ${{ runner.temp }}/opencode-smoke.log
2 changes: 1 addition & 1 deletion .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
ValidatePrTitle:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
- uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Pr

on:
pull_request:
pull_request_target:
workflow_dispatch:

concurrency:
Expand All @@ -18,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
requested_tag: ${{ steps.publish.outputs.requested_tag }}
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262

- uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd
with:
Expand All @@ -39,15 +39,21 @@ jobs:
run: mise run build

- id: inputs
uses: simenandre/setup-inputs@v1
uses: simenandre/setup-inputs@00a2f5d3135898b400343ff87d99b7841e6e4592

- name: Publish candidate to npm with OIDC
id: publish
env:
REQUESTED_TAG: ${{ steps.inputs.outputs.tag }}
run: |
TAG="${{ steps.inputs.outputs.tag }}"
TAG="$REQUESTED_TAG"
if [ -z "$TAG" ]; then
TAG="latest"
fi
case "$TAG" in
latest|next) ;;
*) echo "Unsupported npm tag"; exit 1 ;;
esac

echo "requested_tag=$TAG" >> "$GITHUB_OUTPUT"

Expand All @@ -58,7 +64,7 @@ jobs:
- name: Resolve published version
id: version
run: |
VERSION=$(npm view opencode-synced@next version)
VERSION=$(npm view @tsunamik/opencode-synced@next version)
if [ -z "$VERSION" ]; then
echo "Failed to resolve version from npm tag: next"
exit 1
Expand All @@ -80,7 +86,7 @@ jobs:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262

- uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd
with:
Expand All @@ -96,5 +102,5 @@ jobs:
exit 1
fi

echo "Promoting opencode-synced@$VERSION to latest"
npm dist-tag add "opencode-synced@$VERSION" latest
echo "Promoting @tsunamik/opencode-synced@$VERSION to latest"
npm dist-tag add "@tsunamik/opencode-synced@$VERSION" latest
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
prs_created: ${{ steps.release-please.outputs.prs_created }}
steps:
- uses: google-github-actions/release-please-action@v4
- uses: google-github-actions/release-please-action@8b8fd2cc23b2e18957157a9d923d75aa0c6f6ad5
id: release-please
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -33,15 +33,15 @@ jobs:
steps:
- name: Dispatch publish for releases
if: needs.process.outputs.releases_created == 'true'
uses: peter-evans/repository-dispatch@v2
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: publish-package
client-payload: '{"tag": "latest"}'

- name: Dispatch publish for prerelease
if: needs.process.outputs.prs_created == 'true'
uses: peter-evans/repository-dispatch@v2
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: publish-package
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.9.0"
".": "0.10.0-beta.1"
}
Loading
Loading