Homebrew Tap 发布 Go 二进制包

作为 MacOS 用户,自然是离不开 Homebrew,因为它是 MacOS 的安装包管理工具。本文主要介绍如果将一个 Go 的二进制包发布到 Homebrew Tap 上,然后可以使用 brew install 的方式进行安装 Go 的二进制包。 同时本文会讲解到两种发布方式,一种是纯手动的方式,另一种则是基于 GitHub Actions + GoReleaser 的自动化发布。 ...

January 24, 2022 · 3 min · K8sCat

再见, GitHub

“我送你离开千里之外你无声黑白” – 周杰伦《千里之外》 由于自己写的一个 项目 在线上通过 GitHub API 获取 star, 真的是没有任何预兆, 被 GitHub 官方封号了, 我很难过, 也很后悔, 有一种 生死掌握在别人手中 的感觉, 所以才会有那么多开源的可自托管的Git平台, 比如 GitLab, Gogs, Gitea, 还是用自己托管的Git平台靠谱, 再见, GitHub! {% img http://qiniu.ncucoder.com/github-suspended.png %}

September 29, 2019 · 1 min · K8sCat

Django 接入 GitHub OAuth 的正确姿势

Django 如何正确接入 GitHub OAuth? 项目地址: https://github.com/hsowan/CSDNBot/tree/web 首先, 创建 GitHub OAuth Apps {% img /images/new-github-oauth-app.png %} 其中值得注意的有: Authorization callback URL (认证后的回调地址), 比如: http://localhost:8000/api/login/oauth/code/github/, 在认证之后将跳转到这个地址并带上一个 code 参数, 这个参数会用来请求 access_token Client ID 和 Client Secret 也是用户请求 access_token 的参数 然后, 在 Django 项目中添加路由 from django.urls import re_path from . import apis urlpatterns = [ re_path(r'^api/login/oauth/code/github/?$', apis.github_oauth_callback), ] 实现 github_oauth_callback: import requests from django.conf import settings import json from django.shortcuts import redirect # https://github.com/login/oauth/authorize?client_id=bd4692513cb71ba05c22&scope=user def github_oauth_callback(request): code = request....

August 21, 2019 · 1 min · K8sCat