Compare commits
21 Commits
0.1.0-alph
...
0.1.0-alph
Author | SHA1 | Date | |
---|---|---|---|
![]() |
36ea6a0a72 | ||
![]() |
f901b1fe4f | ||
![]() |
82991b9949 | ||
![]() |
a6a46b8d95 | ||
![]() |
5667d8dbb6 | ||
![]() |
602c33a1eb | ||
![]() |
f5ca38ef0b | ||
![]() |
5531f86da1 | ||
![]() |
cdb497123b | ||
![]() |
8d6e218bf4 | ||
![]() |
ee83d00866 | ||
![]() |
3b39c71835 | ||
![]() |
a4cb86b386 | ||
![]() |
00e1397586 | ||
![]() |
939852cb05 | ||
![]() |
7d71f66080 | ||
![]() |
7ec91b5b5e | ||
![]() |
425d14e3af | ||
![]() |
1575047197 | ||
![]() |
1942b251c7 | ||
![]() |
73219067f4 |
106
.github/workflows/release.yaml
vendored
106
.github/workflows/release.yaml
vendored
@@ -3,63 +3,67 @@ on:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
- releases-windows:
|
||||
releases:
|
||||
name: Release Authorizer Binary
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64
|
||||
goos: [windows]
|
||||
goarch: [amd64]
|
||||
# goarch: ['386', amd64]
|
||||
# exclude:
|
||||
# - goarch: '386'
|
||||
# goos: darwin
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install build-essential gcc_mingw64
|
||||
run: |
|
||||
sudo apt-get install build-essential wget zip gcc-mingw-w64 && \
|
||||
sudo apt-get remove --auto-remove golang-go && \
|
||||
sudo rm -rf /usr/bin/go &&\
|
||||
wget --progress=dot:mega https://golang.org/dl/go1.17.1.linux-amd64.tar.gz -O go-linux.tar.gz && \
|
||||
sudo tar -zxf go-linux.tar.gz && \
|
||||
sudo mv go /usr/bin/ && \
|
||||
sudo mkdir -p /go/bin /go/src /go/pkg && \
|
||||
export GO_HOME=/usr/bin/go && \
|
||||
export GOPATH=/go && \
|
||||
export PATH=${GOPATH}/bin:${GO_HOME}/bin/:$PATH && \
|
||||
echo "/usr/bin/go/bin" >> $GITHUB_PATH
|
||||
echo "/usr/bin/x86_64-w64-mingw32-gcc" >> GITHUB_PATH
|
||||
go version && \
|
||||
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 && \
|
||||
tar -zxf github-assets-uploader.tar.gz && \
|
||||
sudo mv github-assets-uploader /usr/sbin/ && \
|
||||
sudo rm -f github-assets-uploader.tar.gz && \
|
||||
github-assets-uploader -version
|
||||
- name: Print Go paths
|
||||
run: whereis go
|
||||
- name: Print Go Version
|
||||
run: go version
|
||||
- name: Set VERSION env
|
||||
run: echo VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV}
|
||||
- name: Set GO env
|
||||
env:
|
||||
- CGO_ENABLED=1
|
||||
- CC=x86_64-w64-mingw32-gcc
|
||||
- uses: wangyoucao577/go-release-action@v1.20
|
||||
- name: Copy .env file
|
||||
run: mv .env.sample .env
|
||||
- name: Package files for windows
|
||||
run: |
|
||||
make clean && CGO_ENABLED=1 GOOS=windows CC=/usr/bin/x86_64-w64-mingw32-gcc make
|
||||
zip -vr authorizer-${VERSION}-windows-amd64.zip .env app build templates
|
||||
- name: Package files for linux
|
||||
run: |
|
||||
make clean && CGO_ENABLED=1 make
|
||||
tar cvfz authorizer-${VERSION}-linux-amd64.tar.gz .env app build templates
|
||||
- name: Upload assets
|
||||
run: |
|
||||
github-assets-uploader -f authorizer-${VERSION}-windows-amd64.zip -mediatype application/zip -repo authorizerdev/authorizer -token ${{secrets.RELEASE_TOKEN}} -tag ${VERSION} && \
|
||||
github-assets-uploader -f authorizer-${VERSION}-linux-amd64.tar.gz -mediatype application/gzip -repo authorizerdev/authorizer -token ${{secrets.RELEASE_TOKEN}} -tag ${VERSION}
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
with:
|
||||
github_token: ${{ secrets.RELEASE_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
build_command: make clean && make
|
||||
md5sum: FALSE
|
||||
extra_files: .env.sample app build template
|
||||
- releases-darwin:
|
||||
name: Release Authorizer Binary
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64
|
||||
goos: [darwin]
|
||||
goarch: [amd64]
|
||||
# goarch: ['386', amd64]
|
||||
# exclude:
|
||||
# - goarch: '386'
|
||||
# goos: darwin
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install build-essential gcc g++ zlib1g-dev libmpc-dev libmpfr-dev libgmp-dev
|
||||
- name: Set VERSION env
|
||||
run: echo VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV}
|
||||
- name: Set GO env
|
||||
env:
|
||||
- CGO_ENABLED=1
|
||||
- CC=o64-clang
|
||||
- uses: wangyoucao577/go-release-action@v1.20
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
with:
|
||||
github_token: ${{ secrets.RELEASE_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: ${{ matrix.goarch }}
|
||||
build_command: make clean && make
|
||||
md5sum: FALSE
|
||||
extra_files: .env.sample app build template
|
||||
images: lakhansamani/authorizer
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,3 +6,5 @@ build
|
||||
.env
|
||||
data.db
|
||||
.DS_Store
|
||||
.env.local
|
||||
*.tar.gz
|
18
scripts/build-mac.sh
Normal file
18
scripts/build-mac.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
VERSION="$1"
|
||||
make clean && CGO_ENABLED=1 make
|
||||
FILE_NAME=authorizer-${VERSION}-darwin-amd64.tar.gz
|
||||
tar cvfz ${FILE_NAME} .env app build templates
|
||||
AUTH="Authorization: token $GITHUB_TOKEN"
|
||||
RELASE_INFO=$(curl -sH "$AUTH" https://api.github.com/repos/authorizerdev/authorizer/releases/tags/${VERSION})
|
||||
echo $RELASE_INFO
|
||||
|
||||
eval $(echo "$RELASE_INFO" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=')
|
||||
[ "$id" ] || { echo "Error: Failed to get release id for tag: $VERSION"; echo "$RELASE_INFO" | awk 'length($0)<100' >&2; exit 1; }
|
||||
echo $id
|
||||
GH_ASSET="https://uploads.github.com/repos/authorizerdev/authorizer/releases/$id/assets?name=$(basename $FILE_NAME)"
|
||||
|
||||
echo $GH_ASSET
|
||||
|
||||
curl -H $AUTH -H "Content-Type: $(file -b --mime-type $FILE_NAME)" --data-binary @$FILE_NAME $GH_ASSET
|
||||
|
||||
curl "$GITHUB_OAUTH_BASIC" --data-binary @"$FILE_NAME" -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/octet-stream" $GH_ASSET
|
Reference in New Issue
Block a user