Skip to content

Commit dbf83e0

Browse files
author
Derek
committed
fix: Replace Linear CLI with schpet/linear-cli
Switch from npm package @digitalstories/linear-cli to schpet/linear-cli binary releases. The new CLI auto-detects latest version from GitHub and supports both x86_64 and aarch64 Linux architectures. macOS uses Homebrew tap schpet/tap/linear.
1 parent 1daecb9 commit dbf83e0

2 files changed

Lines changed: 65 additions & 19 deletions

File tree

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,60 @@
11
---
2-
# Linear.app CLI installation (user-specific via npm)
2+
# Linear CLI installation (schpet/linear-cli)
3+
# https://github.com/schpet/linear-cli
34

4-
- name: Install Linear CLI globally for user (Linux)
5-
community.general.npm:
6-
name: '@digitalstories/linear-cli'
7-
global: true
8-
state: present
9-
environment:
10-
NPM_CONFIG_PREFIX: "{{ dfe_user_home }}/.npm-global"
11-
become: false
12-
become_user: "{{ dfe_actual_user }}"
13-
when: ansible_distribution in ['Fedora', 'Ubuntu']
5+
# ============================================================================
6+
# MACOS - Install via Homebrew tap
7+
# ============================================================================
148

15-
- name: Install Linear CLI globally for user (macOS)
16-
community.general.npm:
17-
name: '@digitalstories/linear-cli'
18-
global: true
9+
- name: Install Linear CLI (macOS)
10+
community.general.homebrew:
11+
name: schpet/tap/linear
1912
state: present
20-
environment: "{{ npm_config_env }}"
2113
become: false
2214
when: ansible_distribution == 'MacOSX'
15+
16+
# ============================================================================
17+
# LINUX - Install via binary from GitHub releases
18+
# ============================================================================
19+
20+
- name: Install Linear CLI (Linux)
21+
block:
22+
- name: Get latest Linear CLI version from GitHub API
23+
ansible.builtin.uri:
24+
url: https://api.github.com/repos/schpet/linear-cli/releases/latest
25+
return_content: true
26+
register: linear_release
27+
28+
- name: Set Linear CLI version and architecture facts
29+
ansible.builtin.set_fact:
30+
linear_version: "{{ linear_release.json.tag_name }}"
31+
linear_arch: "{{ 'aarch64' if ansible_architecture == 'aarch64' else 'x86_64' }}"
32+
33+
- name: Download Linear CLI binary tarball
34+
ansible.builtin.get_url:
35+
url: "https://github.com/schpet/linear-cli/releases/download/{{ linear_version }}/linear-{{ linear_arch }}-unknown-linux-gnu.tar.xz"
36+
dest: "/tmp/linear.tar.xz"
37+
mode: '0644'
38+
39+
- name: Extract Linear CLI binary
40+
ansible.builtin.unarchive:
41+
src: /tmp/linear.tar.xz
42+
dest: /tmp
43+
remote_src: true
44+
45+
- name: Install Linear CLI binary
46+
ansible.builtin.copy:
47+
src: "/tmp/linear-{{ linear_arch }}-unknown-linux-gnu/linear"
48+
dest: /usr/local/bin/linear
49+
mode: '0755'
50+
remote_src: true
51+
52+
- name: Remove Linear CLI installation files
53+
ansible.builtin.file:
54+
path: "{{ item }}"
55+
state: absent
56+
loop:
57+
- /tmp/linear.tar.xz
58+
- "/tmp/linear-{{ linear_arch }}-unknown-linux-gnu"
59+
60+
when: ansible_distribution in ['Fedora', 'Ubuntu']

ansible/roles/dfe_developer_core/tasks/verify.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,20 @@
5353
failed_when: verify_semrel.rc != 0
5454
become: false
5555

56-
- name: Verify Linear CLI
57-
ansible.builtin.command: "{{ dfe_user_home }}/.npm-global/bin/linear --version"
56+
- name: Verify Linear CLI (Linux)
57+
ansible.builtin.command: linear --version
5858
register: verify_linear
5959
changed_when: false
6060
failed_when: verify_linear.rc != 0
61-
become: false
61+
when: ansible_distribution in ['Fedora', 'Ubuntu']
62+
63+
- name: Verify Linear CLI (macOS)
64+
ansible.builtin.command: linear --version
65+
environment: "{{ homebrew_env }}"
66+
register: verify_linear
67+
changed_when: false
68+
failed_when: verify_linear.rc != 0
69+
when: ansible_distribution == 'MacOSX'
6270

6371
- name: Verify OpenVPN 3 (Linux)
6472
ansible.builtin.command: openvpn3 version

0 commit comments

Comments
 (0)