diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..5c68a56 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,39 @@ +version: 2 +jobs: + build: + machine: + image: ubuntu-2204:2023.10.1 + steps: + - checkout + - run: go install github.com/tcnksm/ghr@v0.16.0 + - run: sudo apt-get update && sudo apt-get install p7zip-full + - run: sudo bash -c "curl -L --output - https://github.com/crazy-max/xgo/releases/download/v0.30.0/xgo_0.30.0_linux_amd64.tar.gz | tar xvz -C /usr/local/bin/ ./xgo" + - run: + command: | + sudo chmod 666 /var/run/docker.sock + if [ -f /var/run/docker-temp.sock ]; then + sudo chmod 666 /var/run/docker-temp.sock + fi + - run: + command: | + export GOPATH=/home/circleci/.go_workspace + make dist + - run: + name: create release + command: | + if [ "$CIRCLE_TAG" ]; then + mkdir -p dist + mv deploylock-client*.zip dist + ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace $CIRCLE_TAG dist/ + else + echo "No tag" + fi +workflows: + version: 2 + build-workflow: # the name of our workflow + jobs: # the jobs that we are sequencing. + - build: + filters: + tags: + only: /^v.*/ +