-
Notifications
You must be signed in to change notification settings - Fork 6
ENG-1767 Setup Linear release for Obsidian #1074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
trangdoan982
wants to merge
9
commits into
main
Choose a base branch
from
eng-1767-setup-linear-release-for-obsidian
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
06ceff5
ENG-1767 Add Obsidian Linear release workflows
trangdoan982 af5bb22
add to test
trangdoan982 db6d8f3
further test
trangdoan982 7b7c14d
test 3
trangdoan982 e837eff
fix bug
trangdoan982 ae6177b
debug instrument
trangdoan982 ab4e9e3
add debug log
trangdoan982 50e349e
cleanup debug instrument
trangdoan982 4424c07
final cleanup
trangdoan982 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: Complete Obsidian Linear Release | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Obsidian release version to complete in Linear, for example 0.1.0." | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| complete-release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Debug complete release inputs | ||
| env: | ||
| GITHUB_RUN_ID: ${{ github.run_id }} | ||
| GITHUB_EVENT_NAME: ${{ github.event_name }} | ||
| GITHUB_REF_NAME: ${{ github.ref_name }} | ||
| INPUT_VERSION: ${{ inputs.version }} | ||
| run: | | ||
| node -e ' | ||
| // #region agent log | ||
| fetch("http://127.0.0.1:7679/ingest/69a70121-d858-4c76-8bf8-e715f33aee20",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"9132dd"},body:JSON.stringify({sessionId:"9132dd",runId:process.env.GITHUB_RUN_ID,hypothesisId:"H4",location:".github/workflows/obsidian-release-complete.yaml:inputs",message:"Complete workflow input values",data:{eventName:process.env.GITHUB_EVENT_NAME,refName:process.env.GITHUB_REF_NAME,inputVersion:process.env.INPUT_VERSION},timestamp:Date.now()})}).catch(()=>{}); | ||
| // #endregion | ||
| ' | ||
|
|
||
| - name: Complete Linear release | ||
| id: complete-linear-release | ||
| uses: linear/linear-release-action@v0 | ||
| with: | ||
| access_key: ${{ secrets.LINEAR_RELEASES_ACCESS_KEY_OBSIDIAN }} | ||
| command: complete | ||
| version: ${{ inputs.version }} | ||
| log_level: verbose |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| name: Publish Obsidian Plugin | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Obsidian release version, for example 0.1.0 or 0.1.0-beta.1." | ||
| required: true | ||
| type: string | ||
| release_name: | ||
| description: "Optional custom GitHub release name." | ||
| required: false | ||
| type: string | ||
| push: | ||
| branches: | ||
| - eng-1767-setup-linear-release-for-obsidian | ||
|
|
||
| env: | ||
| OBSIDIAN_PLUGIN_REPO_TOKEN: ${{ secrets.OBSIDIAN_PLUGIN_REPO_TOKEN }} | ||
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
| SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} | ||
| SUPABASE_PUBLISHABLE_KEY: ${{ secrets.SUPABASE_PUBLISHABLE_KEY }} | ||
| SUPABASE_USE_DB: production | ||
|
|
||
| jobs: | ||
| publish-extension: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| release_version: ${{ steps.resolve-release-inputs.outputs.version }} | ||
| release_name: ${{ steps.resolve-release-inputs.outputs.release_name }} | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.15.1 | ||
| run_install: false | ||
|
|
||
| - name: Setup Node.js environment | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: "pnpm" | ||
|
|
||
| - name: Install Dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Resolve release inputs | ||
| id: resolve-release-inputs | ||
| run: | | ||
| if [ -n "${{ inputs.version }}" ]; then | ||
| version="${{ inputs.version }}" | ||
| else | ||
| base_version="$(node -p "require('./apps/obsidian/package.json').version")" | ||
| version="${base_version}-alpha-ci.${{ github.run_number }}" | ||
| fi | ||
| echo "version=$version" >> "$GITHUB_OUTPUT" | ||
|
|
||
| if [ -n "${{ inputs.release_name }}" ]; then | ||
| release_name="${{ inputs.release_name }}" | ||
| else | ||
| release_name="" | ||
| fi | ||
| echo "release_name=$release_name" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Debug resolved release inputs | ||
| env: | ||
| RESOLVED_VERSION: ${{ steps.resolve-release-inputs.outputs.version }} | ||
| RESOLVED_RELEASE_NAME: ${{ steps.resolve-release-inputs.outputs.release_name }} | ||
| GITHUB_EVENT_NAME: ${{ github.event_name }} | ||
| GITHUB_REF_NAME: ${{ github.ref_name }} | ||
| GITHUB_SHA: ${{ github.sha }} | ||
| GITHUB_RUN_ID: ${{ github.run_id }} | ||
| run: | | ||
| node -e ' | ||
| // #region agent log | ||
| fetch("http://127.0.0.1:7679/ingest/69a70121-d858-4c76-8bf8-e715f33aee20",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"9132dd"},body:JSON.stringify({sessionId:"9132dd",runId:process.env.GITHUB_RUN_ID,hypothesisId:"H1",location:".github/workflows/obsidian-release.yaml:resolve-inputs",message:"Resolved release inputs",data:{eventName:process.env.GITHUB_EVENT_NAME,refName:process.env.GITHUB_REF_NAME,sha:process.env.GITHUB_SHA,resolvedVersion:process.env.RESOLVED_VERSION,resolvedReleaseName:process.env.RESOLVED_RELEASE_NAME},timestamp:Date.now()})}).catch(()=>{}); | ||
| // #endregion | ||
| ' | ||
|
|
||
| - name: Sync Linear release | ||
| id: sync-linear-release | ||
| uses: linear/linear-release-action@v0 | ||
| with: | ||
| access_key: ${{ secrets.LINEAR_RELEASES_ACCESS_KEY_OBSIDIAN }} | ||
| name: Obsidian ${{ steps.resolve-release-inputs.outputs.version }} | ||
| version: ${{ steps.resolve-release-inputs.outputs.version }} | ||
| include_paths: "apps/obsidian/**,packages/tailwind-config/**,packages/utils/**,packages/database/**,packages/ui/**" | ||
| log_level: verbose | ||
|
|
||
| - name: Debug Linear sync result | ||
| if: always() | ||
| env: | ||
| GITHUB_RUN_ID: ${{ github.run_id }} | ||
| RESOLVED_VERSION: ${{ steps.resolve-release-inputs.outputs.version }} | ||
| SYNC_OUTCOME: ${{ steps.sync-linear-release.outcome }} | ||
| SYNC_RELEASE: ${{ steps.sync-linear-release.outputs.release }} | ||
| SYNC_RELEASE_URL: ${{ steps.sync-linear-release.outputs.release-url }} | ||
| run: | | ||
| node -e ' | ||
| // #region agent log | ||
| fetch("http://127.0.0.1:7679/ingest/69a70121-d858-4c76-8bf8-e715f33aee20",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"9132dd"},body:JSON.stringify({sessionId:"9132dd",runId:process.env.GITHUB_RUN_ID,hypothesisId:"H2",location:".github/workflows/obsidian-release.yaml:sync-result",message:"Linear sync step result",data:{resolvedVersion:process.env.RESOLVED_VERSION,syncOutcome:process.env.SYNC_OUTCOME,syncRelease:process.env.SYNC_RELEASE,syncReleaseUrl:process.env.SYNC_RELEASE_URL},timestamp:Date.now()})}).catch(()=>{}); | ||
| // #endregion | ||
| ' | ||
|
|
||
| - name: Publish Obsidian extension | ||
| run: | | ||
| if [ -n "${{ steps.resolve-release-inputs.outputs.release_name }}" ]; then | ||
| pnpm --dir apps/obsidian run publish --version "${{ steps.resolve-release-inputs.outputs.version }}" --release-name "${{ steps.resolve-release-inputs.outputs.release_name }}" | ||
| else | ||
| pnpm --dir apps/obsidian run publish --version "${{ steps.resolve-release-inputs.outputs.version }}" | ||
| fi | ||
|
|
||
| - name: Mark Linear release sent to Obsidian review | ||
| id: update-linear-release | ||
| uses: linear/linear-release-action@v0 | ||
| with: | ||
| access_key: ${{ secrets.LINEAR_RELEASES_ACCESS_KEY_OBSIDIAN }} | ||
| command: update | ||
| version: ${{ steps.resolve-release-inputs.outputs.version }} | ||
| stage: In Progress | ||
| log_level: verbose | ||
|
|
||
| - name: Debug Linear update result | ||
| if: always() | ||
| env: | ||
| GITHUB_RUN_ID: ${{ github.run_id }} | ||
| RESOLVED_VERSION: ${{ steps.resolve-release-inputs.outputs.version }} | ||
| UPDATE_OUTCOME: ${{ steps.update-linear-release.outcome }} | ||
| UPDATE_RELEASE: ${{ steps.update-linear-release.outputs.release }} | ||
| UPDATE_RELEASE_URL: ${{ steps.update-linear-release.outputs.release-url }} | ||
| run: | | ||
| node -e ' | ||
| // #region agent log | ||
| fetch("http://127.0.0.1:7679/ingest/69a70121-d858-4c76-8bf8-e715f33aee20",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"9132dd"},body:JSON.stringify({sessionId:"9132dd",runId:process.env.GITHUB_RUN_ID,hypothesisId:"H3",location:".github/workflows/obsidian-release.yaml:update-result",message:"Linear update step result",data:{resolvedVersion:process.env.RESOLVED_VERSION,updateOutcome:process.env.UPDATE_OUTCOME,updateRelease:process.env.UPDATE_RELEASE,updateReleaseUrl:process.env.UPDATE_RELEASE_URL},timestamp:Date.now()})}).catch(()=>{}); | ||
| // #endregion | ||
| ' | ||
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.