Skip to content

Commit

Permalink
Merge branch 'dev' into feat/cicd_deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
IRONICBo authored Jan 25, 2024
2 parents 104c314 + 8bca5db commit b5ed287
Show file tree
Hide file tree
Showing 40 changed files with 4,040 additions and 112,359 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release Build

on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2

- name: Checkout tag
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
tag_name="${GITHUB_REF##*/}"
echo Current tag: $tag_name
git checkout $tag_name
echo "TAG_NAME=${tag_name}" >> $GITHUB_ENV
- name: Check VERSION consistency
run: |
tag=$(git describe --tags --dirty)
version=$(cat VERSION)
if [ "$tag" != "$version" ]; then
echo "VERSION file is not consistent with tag name"
echo "VERSION: $version"
echo "TAG: $tag"
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.19"

- name: Release with goreleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean -p 4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Upload deb/rpm to Fury.io
# run: |
# for file in dist/*.{deb,rpm}
# do
# echo "Uploading $file to Fury.io"
# curl -sS -F package=@$file https://[email protected]/goplus/
# done
# env:
# FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@

# Go workspace file
go.work

# env file
.env

# Autogenerated files from goplus generate
gop_autogen.go
50 changes: 50 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com

# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

before:
hooks:
# You may remove this if you don't use go modules.
# you may remove this if you don't need go generate

builds:
- id: 'gopcomm'
main: ./cmd/gopcomm/gop_autogen.go
binary: gopcomm
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ WORKDIR /community/cmd/gopcomm

COPY --from=builder /community /community

CMD ["./community"]
CMD ["./community"]
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,46 @@ Go+ Community written in Go+
[![GitHub release](https://img.shields.io/github/v/tag/goplus/community.svg?label=release)](https://github.com/goplus/community/releases)
[![Coverage Status](https://codecov.io/gh/goplus/community/branch/main/graph/badge.svg)](https://codecov.io/gh/goplus/community)
[![GoDoc](https://pkg.go.dev/badge/github.com/goplus/community.svg)](https://pkg.go.dev/github.com/goplus/community)

### 🧳 Features

Go+ Community written in Go+ and Yap, support Go+ Community development.


### 🚀 How to run

1. **Prepare golang and goplus environment.**

- golang version >= 1.19
- https://go.dev/dl/ (golang download, Find the golang 1.19 version)
- goplus version == v1.2.0-pre.1
- Ref: https://github.com/goplus/gop/releases
- How to install goplus: https://github.com/goplus/gop#how-to-install

2. **Prepare for your own config**

- Clone a file named `.env` from `.env_temp` in the `cmd/gopcomm` directory of the project.
- Modify the `.env` file to your own configuration.

3. **Run the project**

- Run the project with the following command:

```shell
gop run .
```

- Open the browser and enter the address: `http://localhost:8080` or `GOP_COMMUNITY_ENDPOINT` in your `.env` file.


### 📦 Contribute

1. **Fork the repository to your local repo**

2. **Modify your own code**

3. **Commit your code**

4. **Create a pull request**

> **Note:** Please check the PR brach is `mvp-20240119` or not.
41 changes: 41 additions & 0 deletions cmd/gopcomm/.env_temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Copyright (c) 2023 The GoPlus Authors (goplus.org). All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

### Account Config
GOP_ACCOUNT_ENDPOINT="0.0.0.0:8081"

### Community Config
GOP_COMMUNITY_ENDPOINT="0.0.0.0:8080"

# Database DSN
GOP_COMMUNITY_DSN=

# Qiniu Storage
GOP_COMMUNITY_BLOBUS=
GOP_COMMUNITY_DOMAIN=

# Qiniu Dora Service
QINIU_ACCESS_KEY=
QINIU_SECRET_KEY=

# XiaoQiu Translation Service
QIU_TRANSLATION_KEY=

# XiaoQiu Translation Service
NIUTRANS_API_KEY=

# Casdoor config
GOP_CASDOOR_CERTIFICATE=
Loading

0 comments on commit b5ed287

Please sign in to comment.