diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20ca627..4014144 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,9 @@ name: Build on: push: - branches: ["main"] + branches: + - main + - developer pull_request: branches: ["main"] @@ -17,17 +19,16 @@ jobs: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: false - - name: Version - id: semantic - uses: codacy/git-version@2.4.0 + - uses: go-semantic-release/action@v1 with: - release-branch: master - dev-branch: developer - prefix: v. + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Dependencies run: sudo apt-get install libcurl4-openssl-dev - name: Build - run: make build APP=caos VERSION=${{ steps.semantic.outputs.version }} + run: make build APP=caos diff --git a/.gitignore b/.gitignore index 0921ced..fcb3ca9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ src/export* src/training* src/.env src/test/.env +.env diff --git a/src/.releaserc b/src/.releaserc new file mode 100644 index 0000000..76375d3 --- /dev/null +++ b/src/.releaserc @@ -0,0 +1,7 @@ +branches: + - name: "main" + +plugins: + - "@semantic-release/commit-analyzer" + - "@semantic-release/release-notes-generator" + - "@semantic-release/github" \ No newline at end of file diff --git a/src/makefile b/src/makefile index f53a8d3..7d737bf 100644 --- a/src/makefile +++ b/src/makefile @@ -3,7 +3,12 @@ VERSION=v.0.0.0 PKG_LIST=$(go list ./... | grep -v /vendor/ | tr '\n' ' ') build: - go build -o ./bin/${APP}-${VERSION} + mkdir bin + mkdir bin/caos + cp .env ./bin/caos + cp -r template ./bin/caos + go build -o ./bin/caos/${APP} + clean: go clean @@ -28,7 +33,7 @@ env: openssl x509 -in localCA.crt -out localCA.pem -outform PEM run: - ./bin/${APP}-${VERSION} + ./bin/caos/${APP} test: go test ./...