From 8cdbbd061c4a45f3e4d815a4b3140b190d817fc1 Mon Sep 17 00:00:00 2001 From: Quentin Faidide Date: Mon, 6 May 2024 13:13:02 +0300 Subject: [PATCH] ci: setup testing and semantic versionning in ci --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ .releaserc.yml | 9 ++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .releaserc.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..509a52d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release +on: + push: + branches: + - master + +permissions: + contents: read # for checkout + +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + id-token: write # to enable use of OIDC for npm provenance + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.22.2' + - name: Run tests + run: go test ./... + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "lts/*" + - name: Install dependencies + run: npm install semantic-release + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release@v23.0.8 \ No newline at end of file diff --git a/.releaserc.yml b/.releaserc.yml new file mode 100644 index 0000000..ef5591e --- /dev/null +++ b/.releaserc.yml @@ -0,0 +1,9 @@ +plugins: + - "@semantic-release/commit-analyzer" + - "@semantic-release/release-notes-generator" + - "@semantic-release/github" +branches: + - "master" + - "+([0-9])?(.{+([0-9]),x}).x" + - name: "alpha" + prerelease: "alpha" \ No newline at end of file