Skip to content

Commit 54cb141

Browse files
authored
ci: remove unnecessary steps & cleanup (#118)
* refactor(ci): refactor GitHub Actions for better readablility * upd * remove ""
1 parent 6fb6603 commit 54cb141

5 files changed

Lines changed: 63 additions & 56 deletions

File tree

.github/actions/compare-bun-version/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
name: Compare Bun Version
1+
name: ⚖️ Compare Bun Version
22
description: Compare the version of Bun to a specified version
33

44
inputs:
55
bun-version:
6-
description: "The version of Bun to compare against"
6+
description: The version of Bun to compare against
77
required: true
88
default: "1.1.0"
99

1010
runs:
11-
using: "composite"
11+
using: composite
1212
steps:
13-
- name: Get installed Bun version
13+
- name: 🛠️ Get installed Bun version
1414
id: bun
1515
shell: bash
1616
run: |
1717
bun --version
1818
echo "version=$(bun --version)" >> $GITHUB_OUTPUT
1919
20-
- name: Compare versions
20+
- name: ⚖️ Compare versions
2121
shell: bash
2222
run: |
2323
if [[ "${{ steps.bun.outputs.version }}" == "${{ inputs.bun-version }}" ]]; then

.github/workflows/format.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@ jobs:
1414
format:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: Checkout
17+
- name: 📥 Checkout
1818
uses: actions/checkout@v4
19-
- name: Setup Node
19+
20+
- name: 🛠️ Setup Node
2021
uses: actions/setup-node@v4
2122
with:
2223
node-version: 20.x
23-
- name: Install Dependencies
24+
25+
- name: 📦 Install Dependencies
2426
run: npm install
25-
- name: Format
27+
28+
- name: 🧹 Format
2629
run: |
2730
npm run format
2831
npm run build
29-
- name: Commit
32+
33+
- name: 💾 Commit
3034
uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc

.github/workflows/release.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
name: Release new action version
1+
name: 🚀 Release new action version
22

33
on:
44
release:
55
types: [released]
6+
67
workflow_dispatch:
78
inputs:
89
TAG_NAME:
9-
description: 'Tag name that the major tag will point to'
10+
description: Tag name that the major tag will point to
1011
required: true
1112

12-
env:
13-
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
13+
permissions:
14+
contents: write
1415

1516
jobs:
1617
update_tag:
1718
runs-on: ubuntu-latest
18-
permissions:
19-
contents: write
19+
2020
steps:
2121
- uses: actions/checkout@v4
2222

2323
- uses: actions/publish-action@v0.3.0
24+
env:
25+
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
2426
with:
2527
source-tag: ${{ env.TAG_NAME }}

.github/workflows/test.yml

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: 🧪 Test
22

33
on:
44
workflow_dispatch:
@@ -15,28 +15,19 @@ jobs:
1515
runs-on: ubuntu-latest
1616
permissions: write-all
1717
steps:
18-
- name: Checkout
18+
- name: 📥 Checkout
1919
uses: actions/checkout@v4
2020

21-
- name: Install github cli
22-
run: |
23-
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
24-
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
25-
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
26-
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
27-
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
28-
&& sudo apt update \
29-
&& sudo apt install gh -y
30-
31-
- run: |
32-
gh cache delete --all || true
21+
- name: 🗑️ Remove cache
22+
run: gh cache delete --all || true
3323
env:
3424
GH_TOKEN: ${{ github.token }}
3525

3626
setup-bun:
3727
runs-on: ${{ matrix.os }}
3828
continue-on-error: true
3929
needs: [remove-cache]
30+
4031
strategy:
4132
matrix:
4233
os:
@@ -54,17 +45,18 @@ jobs:
5445
# Disable <sha> support for now. This is because Github Artifacts
5546
# expire after 90 days, and we don't have another source of truth yet.
5647
# - "822a00c4d508b54f650933a73ca5f4a3af9a7983" # 1.0.0 commit
48+
5749
steps:
58-
- name: Checkout
50+
- name: 📥 Checkout
5951
uses: actions/checkout@v4
6052

61-
- name: Setup Bun
53+
- name: 🛠️ Setup Bun
6254
uses: ./
6355
id: setup_bun
6456
with:
6557
bun-version: ${{ matrix.bun-version }}
6658

67-
- name: Run Bun
59+
- name: ▶️ Run Bun
6860
id: run_bun
6961
run: |
7062
bun --version
@@ -80,52 +72,56 @@ jobs:
8072
- ubuntu-latest
8173
- macos-latest
8274
- windows-latest
75+
8376
file:
8477
- name: package.json (bun@1.1.0)
8578
file: package.json
8679
run: |
8780
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > package.json
81+
8882
- name: /foo/package.json (bun@1.1.0)
8983
file: /foo/package.json
9084
run: |
9185
echo "$(jq '. += {"packageManager": "bun@1.1.0"}' package.json)" > /foo/package.json
86+
9287
- name: package.json (yarn@bun@1.1.0)
9388
file: package.json
9489
run: |
9590
echo "$(jq '. += {"packageManager": "yarn@bun@1.1.0"}' package.json)" > package.json
91+
9692
- name: .tool-versions (bun 1.1.0)
9793
file: .tool-versions
98-
run: |
99-
echo "bun 1.1.0" > .tool-versions
94+
run: echo "bun 1.1.0" > .tool-versions
95+
10096
- name: .tool-versions (bun1.1.0)
10197
file: .tool-versions
102-
run: |
103-
echo "bun1.1.0" > .tool-versions
98+
run: echo "bun1.1.0" > .tool-versions
99+
104100
- name: .tool-versions (bun 1.1.0)
105101
file: .tool-versions
106-
run: |
107-
echo "bun 1.1.0" > .tool-versions
102+
run: echo "bun 1.1.0" > .tool-versions
103+
108104
- name: .bumrc (1.1.0)
109105
file: .bumrc
110-
run: |
111-
echo "1.1.0" > .bumrc
106+
run: echo "1.1.0" > .bumrc
107+
112108
- name: .bun-version (1.1.0)
113109
file: .bun-version
114-
run: |
115-
echo "1.1.0" > .bun-version
110+
run: echo "1.1.0" > .bun-version
111+
116112
steps:
117-
- name: Checkout
113+
- name: 📥 Checkout
118114
uses: actions/checkout@v4
119115

120-
- name: Setup file
116+
- name: 📄 Setup file
121117
run: ${{ matrix.file.run }}
122118

123-
- name: Setup Bun
119+
- name: 🛠️ Setup Bun
124120
uses: ./
125121
with:
126122
bun-version-file: ${{ matrix.file.file }}
127123

128-
- name: Compare versions
124+
- name: ⚖️ Compare versions
129125
uses: ./.github/actions/compare-bun-version
130126
with:
131127
bun-version: "1.1.0"
@@ -135,23 +131,25 @@ jobs:
135131
runs-on: ${{ matrix.os }}
136132
continue-on-error: true
137133
needs: [remove-cache]
134+
138135
strategy:
139136
matrix:
140137
os:
141138
- ubuntu-latest
142139
- macos-latest
143140
- windows-latest
141+
144142
steps:
145-
- name: Checkout
143+
- name: 📥 Checkout
146144
uses: actions/checkout@v4
147145

148-
- name: Setup Bun
146+
- name: 🛠️ Setup Bun
149147
uses: ./
150148
id: setup_bun
151149
with:
152150
bun-download-url: "https://github.com/oven-sh/bun/releases/latest/download/bun-${{runner.os == 'macOS' && 'darwin' || runner.os}}-${{ runner.arch == 'X64' && 'x64' || 'aarch64' }}.zip"
153151

154-
- name: Run Bun
152+
- name: ▶️ Run Bun
155153
id: run_bun
156154
run: |
157155
bun --version

action.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
name: Setup Bun
22
description: Download, install, and setup Bun to your path.
33
author: robobun
4+
45
branding:
56
icon: play-circle
67
color: white
8+
79
inputs:
810
bun-version:
9-
description: 'The version of Bun to install. (e.g. "latest", "canary", "1.0.0", "1.0.x", <sha>)'
11+
description: The version of Bun to install. (e.g. "latest", "canary", "1.0.0", "1.0.x", <sha>)
1012
required: false
1113
bun-version-file:
12-
description: 'The version of Bun to install from file. (e.g. "package.json", ".bun-version", ".tool-versions")'
14+
description: The version of Bun to install from file. (e.g. "package.json", ".bun-version", ".tool-versions")
1315
default: null
1416
required: false
1517
bun-download-url:
16-
description: "Override the URL to download Bun from. This skips version resolution and verifying AVX2 support."
18+
description: Override the URL to download Bun from. This skips version resolution and verifying AVX2 support.
1719
required: false
1820
registry-url:
1921
required: false
20-
description: "The URL of the package registry to use for installing Bun. Set the $BUN_AUTH_TOKEN environment variable to authenticate with the registry."
22+
description: The URL of the package registry to use for installing Bun. Set the $BUN_AUTH_TOKEN environment variable to authenticate with the registry.
2123
scope:
2224
required: false
23-
description: "The scope for authenticating with the package registry."
25+
description: The scope for authenticating with the package registry.
2426
no-cache:
2527
required: false
2628
type: boolean
2729
default: false
28-
description: "Disable caching of bun executable."
30+
description: Disable caching of bun executable.
31+
2932
outputs:
3033
bun-version:
3134
description: The version of Bun that was installed.

0 commit comments

Comments
 (0)