Skip to content

Commit 686ef95

Browse files
chore: fix yaml
1 parent 4fe3d55 commit 686ef95

2 files changed

Lines changed: 11 additions & 55 deletions

File tree

.github/workflows/nightly.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ jobs:
4545
CFG="github.com/NodeOps-app/createos-cli/internal/config"
4646
COMMIT="${{ github.sha }}"
4747
LDFLAGS="-s -w -X ${PKG}.Version=${VERSION} -X ${PKG}.Channel=nightly -X ${PKG}.Commit=${COMMIT} -X ${CFG}.OAuthClientID=${{ secrets.OAUTH_CLIENT_ID }}"
48-
4948
if [ "${{ matrix.goos }}" = "windows" ]; then
5049
BINARY="createos-${{ matrix.goos }}-${{ matrix.goarch }}.exe"
5150
else
5251
BINARY="createos-${{ matrix.goos }}-${{ matrix.goarch }}"
5352
fi
54-
5553
go build -trimpath -ldflags="${LDFLAGS}" -o "${BINARY}" .
5654
sha256sum "${BINARY}" | awk '{print $1}' > "${BINARY}.sha256"
5755

.github/workflows/release.yaml

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ jobs:
4545
CFG="github.com/NodeOps-app/createos-cli/internal/config"
4646
COMMIT="${{ github.sha }}"
4747
LDFLAGS="-s -w -X ${PKG}.Version=${VERSION} -X ${PKG}.Channel=stable -X ${PKG}.Commit=${COMMIT} -X ${CFG}.OAuthClientID=${{ secrets.OAUTH_CLIENT_ID }}"
48-
4948
if [ "${{ matrix.goos }}" = "windows" ]; then
5049
BINARY="createos-${{ matrix.goos }}-${{ matrix.goarch }}.exe"
5150
else
5251
BINARY="createos-${{ matrix.goos }}-${{ matrix.goarch }}"
5352
fi
54-
5553
go build -trimpath -ldflags="${LDFLAGS}" -o "${BINARY}" .
5654
sha256sum "${BINARY}" | awk '{print $1}' > "${BINARY}.sha256"
5755
@@ -78,62 +76,22 @@ jobs:
7876
merge-multiple: true
7977

8078
- name: Upload release assets
81-
run: gh release upload "${{ github.ref_name }}" createos-* --clobber
79+
run: gh release upload "${{ github.ref_name }}" createos-* --clobber --repo NodeOps-app/createos-cli
8280

8381
- name: Update homebrew formula
8482
run: |
8583
VERSION="${{ github.ref_name }}"
8684
VERSION_NUM="${VERSION#v}"
87-
BASE="https://github.com/NodeOps-app/createos-cli/releases/download/${VERSION}"
88-
89-
DARWIN_ARM64=$(curl -sL "${BASE}/createos-darwin-arm64.sha256")
90-
DARWIN_AMD64=$(curl -sL "${BASE}/createos-darwin-amd64.sha256")
91-
LINUX_ARM64=$(curl -sL "${BASE}/createos-linux-arm64.sha256")
92-
LINUX_AMD64=$(curl -sL "${BASE}/createos-linux-amd64.sha256")
93-
94-
cat > Formula/createos.rb <<FORMULA
95-
class Createos < Formula
96-
desc "CreateOS CLI - Manage your infrastructure"
97-
homepage "https://github.com/NodeOps-app/createos-cli"
98-
version "${VERSION_NUM}"
99-
license "MIT"
100-
101-
on_macos do
102-
on_arm do
103-
url "${BASE}/createos-darwin-arm64"
104-
sha256 "${DARWIN_ARM64}"
105-
end
106-
107-
on_intel do
108-
url "${BASE}/createos-darwin-amd64"
109-
sha256 "${DARWIN_AMD64}"
110-
end
111-
end
112-
113-
on_linux do
114-
on_arm do
115-
url "${BASE}/createos-linux-arm64"
116-
sha256 "${LINUX_ARM64}"
117-
end
118-
119-
on_intel do
120-
url "${BASE}/createos-linux-amd64"
121-
sha256 "${LINUX_AMD64}"
122-
end
123-
end
124-
125-
def install
126-
os = OS.mac? ? "darwin" : "linux"
127-
arch = Hardware::CPU.arm? ? "arm64" : "amd64"
128-
bin.install "createos-\#{os}-\#{arch}" => "createos"
129-
end
130-
131-
test do
132-
system "\#{bin}/createos", "version"
133-
end
134-
end
135-
FORMULA
136-
85+
DARWIN_ARM64_SHA=$(curl -sL "https://github.com/NodeOps-app/createos-cli/releases/download/${VERSION}/createos-darwin-arm64.sha256")
86+
DARWIN_AMD64_SHA=$(curl -sL "https://github.com/NodeOps-app/createos-cli/releases/download/${VERSION}/createos-darwin-amd64.sha256")
87+
LINUX_AMD64_SHA=$(curl -sL "https://github.com/NodeOps-app/createos-cli/releases/download/${VERSION}/createos-linux-amd64.sha256")
88+
LINUX_ARM64_SHA=$(curl -sL "https://github.com/NodeOps-app/createos-cli/releases/download/${VERSION}/createos-linux-arm64.sha256")
89+
sed -i "s/version \".*\"/version \"${VERSION_NUM}\"/" Formula/createos.rb
90+
sed -i "s|releases/download/v[^/]*/|releases/download/${VERSION}/|g" Formula/createos.rb
91+
sed -i "/darwin-arm64/{n;s/sha256 \".*\"/sha256 \"${DARWIN_ARM64_SHA}\"/}" Formula/createos.rb
92+
sed -i "/darwin-amd64/{n;s/sha256 \".*\"/sha256 \"${DARWIN_AMD64_SHA}\"/}" Formula/createos.rb
93+
sed -i "/linux-arm64/{n;s/sha256 \".*\"/sha256 \"${LINUX_ARM64_SHA}\"/}" Formula/createos.rb
94+
sed -i "/linux-amd64/{n;s/sha256 \".*\"/sha256 \"${LINUX_AMD64_SHA}\"/}" Formula/createos.rb
13795
git config user.name "github-actions"
13896
git config user.email "github-actions@github.com"
13997
git add Formula/createos.rb

0 commit comments

Comments
 (0)