-
Notifications
You must be signed in to change notification settings - Fork 7
ENG-1767 Setup Linear release for Obsidian #1253
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
6
commits into
main
Choose a base branch
from
eng-1767-setup-linear-release-for-obsidian-v2
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 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fbf416d
ENG-1767 Setup Linear release for Obsidian
trangdoan982 d69b783
ENG-1767 Bump obsidian baseline version to 1.5.2
trangdoan982 375e433
ENG-1767 Drop unusable SUPABASE_USE_DB=production from stable workflow
trangdoan982 ea8818f
ENG-1767 Drop the version-format and re-release guard steps
trangdoan982 8ba311f
ENG-1767 Merge main, rename workflow, fix Linear key and shell injection
trangdoan982 2a38b23
ENG-1767 Make createGithubRelease idempotent on re-run
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
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,91 @@ | ||
| name: Stable Obsidian Release | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Stable version to release, e.g. 1.6.0. Must match an existing Linear release version." | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| env: | ||
| OBSIDIAN_PLUGIN_REPO_TOKEN: ${{ secrets.OBSIDIAN_PLUGIN_REPO_TOKEN }} | ||
| SUPABASE_USE_DB: production | ||
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | ||
| SUPABASE_PUBLISHABLE_KEY: ${{ secrets.SUPABASE_PUBLISHABLE_KEY }} | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Validate version format | ||
| run: | | ||
| if ! [[ "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| echo "::error::Version '${{ inputs.version }}' is not a valid stable version (expected x.y.z)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v6 | ||
| with: | ||
| version: 10.15.1 | ||
| run_install: false | ||
|
|
||
| - name: Setup Node.js environment | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: "22" | ||
| cache: "pnpm" | ||
|
|
||
| - name: Install Dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Guard against re-releasing an already-shipped version | ||
| run: | | ||
| CURRENT_VERSION=$(node -p "require('./apps/obsidian/package.json').version") | ||
| CURRENT_BASE="${CURRENT_VERSION%%-*}" | ||
| INPUT_VERSION="${{ inputs.version }}" | ||
| HIGHEST=$(printf '%s\n%s\n' "$CURRENT_BASE" "$INPUT_VERSION" | sort -V | tail -n1) | ||
| if [ "$HIGHEST" != "$INPUT_VERSION" ]; then | ||
| echo "::error::Requested version $INPUT_VERSION is behind the current version $CURRENT_VERSION." | ||
| exit 1 | ||
| fi | ||
| if [ "$CURRENT_BASE" == "$INPUT_VERSION" ] && [[ "$CURRENT_VERSION" != *-beta.* ]]; then | ||
| echo "::error::Version $INPUT_VERSION has already been released (current version is $CURRENT_VERSION)." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Publish stable release | ||
| run: cd apps/obsidian && npx tsx scripts/publish.ts --version ${{ inputs.version }} | ||
|
trangdoan982 marked this conversation as resolved.
Outdated
|
||
|
|
||
| - name: Commit version bump | ||
| run: | | ||
| if ! git diff --quiet -- apps/obsidian/package.json apps/obsidian/manifest.json; then | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add apps/obsidian/package.json apps/obsidian/manifest.json | ||
| git commit -m "chore: release obsidian ${{ inputs.version }} [skip ci]" | ||
| git push | ||
| fi | ||
|
|
||
| - name: Sync Linear release | ||
| uses: linear/linear-release-action@v0 | ||
| with: | ||
| access_key: ${{ secrets.LINEAR_RELEASES_ACCESS_KEY }} | ||
|
trangdoan982 marked this conversation as resolved.
Outdated
|
||
| command: sync | ||
| version: ${{ inputs.version }} | ||
| include_paths: "apps/obsidian/**,packages/database/**,packages/utils/**" | ||
|
|
||
| - name: Complete Linear release | ||
| uses: linear/linear-release-action@v0 | ||
| with: | ||
| access_key: ${{ secrets.LINEAR_RELEASES_ACCESS_KEY }} | ||
| command: complete | ||
| version: ${{ inputs.version }} | ||
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
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
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
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
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.