diff --git a/.github/workflows/.releaserc b/.github/workflows/.releaserc new file mode 100644 index 00000000..8511bf5f --- /dev/null +++ b/.github/workflows/.releaserc @@ -0,0 +1,16 @@ +--- +branches: +- master +plugins: +- - "@semantic-release/commit-analyzer" + - preset: conventionalcommits +- - "@semantic-release/release-notes-generator" + - preset: conventionalcommits +- - "@semantic-release/github" + - assets: + - path: asyncapi-parser.darwin.amd64 + label: Binary - Darwin AMD64 + - path: asyncapi-parser.linux.amd64 + label: Binary - Linux AMD64 + - path: asyncapi-parser.windows.amd64.exe + label: Binary - Windows AMD64 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..8a6fc79b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: Release + +on: + push: + branches: + - master + +jobs: + test: + name: 'Testing' + runs-on: ubuntu-latest + strategy: + matrix: + go: + - '1.14' + - '1.13' + - '1.12' + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v1.1.2 + with: + go-version: '${{ matrix.go }}' + - name: Invoking go test + run: go test ./... + + release: + name: 'Release to GitHub' + runs-on: ubuntu-latest + needs: + - test + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v1.1.2 + with: + go-version: '1.14' + - name: Invoking go vet and binaries generation + run: | + go vet ./... + GOOS=darwin GOARCH=amd64 go build -o=.github/workflows/asyncapi-parser.darwin.amd64 ./cmd/api-parser/main.go + GOOS=linux GOARCH=amd64 go build -o=.github/workflows/asyncapi-parser.linux.amd64 ./cmd/api-parser/main.go + GOOS=windows GOARCH=amd64 go build -o=.github/workflows/asyncapi-parser.windows.amd64.exe ./cmd/api-parser/main.go + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 13 + - name: Add plugin for conventional commits + run: npm install conventional-changelog-conventionalcommits + working-directory: ./.github/workflows + - name: Release to GitHub + working-directory: ./.github/workflows + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GIT_AUTHOR_NAME: asyncapi-bot + GIT_AUTHOR_EMAIL: info@asyncapi.io + GIT_COMMITTER_NAME: asyncapi-bot + GIT_COMMITTER_EMAIL: info@asyncapi.io + run: npx semantic-release diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 69f95878..00000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: go - -go: - - 1.12.x - -env: - - GO111MODULE=on - -script: - - go vet ./... - - go test ./... - - env GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=${TRAVIS_BUILD_NUMBER}" -o=api-parser.darwin.amd64 ./cmd/api-parser/main.go - - env GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=${TRAVIS_BUILD_NUMBER}" -o=api-parser.linux.amd64 ./cmd/api-parser/main.go - - env GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=${TRAVIS_BUILD_NUMBER}" -o=api-parser.windows.amd64.exe ./cmd/api-parser/main.go - -deploy: - provider: releases - api_key: $GH_TOKEN - file: - - api-parser.darwin.amd64 - - api-parser.linux.amd64 - - api-parser.windows.amd64.exe - skip_cleanup: true - on: - tags: true diff --git a/README.md b/README.md index 0c32cf20..de68fd15 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ To install the AsyncAPI Parser package, run: go get github.com/asyncapi/parser-go/... ``` +> **TIP:** You can also get binaries from the [latest GitHub release](https://github.com/asyncapi/parser-go/releases/latest). + ## Usage You can use the AsyncAPI Parser in two ways: