Skip to content

Commit a6a46b8

Browse files
committed
feat: add mac script
fix: release script
1 parent 5667d8d commit a6a46b8

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
export GOPATH=/go && \
2222
export PATH=${GOPATH}/bin:${GO_HOME}/bin/:$PATH && \
2323
echo "/usr/bin/go/bin" >> $GITHUB_PATH
24+
echo "/usr/bin/x86_64-w64-mingw32-gcc" >> GITHUB_PATH
2425
go version && \
2526
wget --no-check-certificate --progress=dot:mega https://github.com/wangyoucao577/assets-uploader/releases/download/v0.3.0/github-assets-uploader-v0.3.0-linux-amd64.tar.gz -O github-assets-uploader.tar.gz && \
2627
tar -zxf github-assets-uploader.tar.gz && \
@@ -46,7 +47,7 @@ jobs:
4647
- name: Upload assets
4748
run: |
4849
github-assets-uploader -f authorizer-${VERSION}-windows-amd64.zip -mediatype application/zip -repo authorizerdev/authorizer -token ${{secrets.RELEASE_TOKEN}} -tag ${VERSION} && \
49-
github-assets-uploader -f authorizer-${VERSION}-linux-amd64.tar.gz -mediatype application/gzip -repo authorizerdev/authorizer -token ${{secrets.RELEASE_TOKEN}} -tag ${VERSION} && \
50+
github-assets-uploader -f authorizer-${VERSION}-linux-amd64.tar.gz -mediatype application/gzip -repo authorizerdev/authorizer -token ${{secrets.RELEASE_TOKEN}} -tag ${VERSION}
5051
5152
# - uses: wangyoucao577/[email protected]
5253
# with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ build
66
.env
77
data.db
88
.DS_Store
9+
.env.local
10+
*.tar.gz

scripts/build-mac.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
VERSION="$1"
2+
# make clean && CGO_ENABLED=1 make
3+
FILE_NAME=authorizer-${VERSION}-darwin-amd64.tar.gz
4+
# tar cvfz ${FILE_NAME} .env app build templates
5+
AUTH="Authorization: token $GITHUB_TOKEN"
6+
RELASE_INFO=$(curl -sH "$AUTH" https://api.github.com/repos/authorizerdev/authorizer/releases/tags/${VERSION})
7+
echo $RELASE_INFO
8+
9+
eval $(echo "$RELASE_INFO" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=')
10+
[ "$id" ] || { echo "Error: Failed to get release id for tag: $VERSION"; echo "$RELASE_INFO" | awk 'length($0)<100' >&2; exit 1; }
11+
echo $id
12+
GH_ASSET="https://uploads.github.com/repos/authorizerdev/authorizer/releases/$id/assets?name=$(basename $FILE_NAME)"
13+
14+
echo $GH_ASSET
15+
16+
curl -H $AUTH -H "Content-Type: $(file -b --mime-type $FILE_NAME)" --data-binary @$FILE_NAME $GH_ASSET
17+
18+
curl "$GITHUB_OAUTH_BASIC" --data-binary @"$FILE_NAME" -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/octet-stream" $GH_ASSET

0 commit comments

Comments
 (0)