From acdfbab0e7c41f8c147225dbd3208a1aa68f91eb Mon Sep 17 00:00:00 2001 From: Stelio Sergio Date: Thu, 26 Oct 2023 13:16:09 +0200 Subject: [PATCH] wip: add goreleaser in the workflow execute git hub actions on any push or PR only create release from master --- .github/workflows/go.yml | 25 ++++++++++++++++--------- .gitignore | 1 + .goreleaser.yaml | 2 +- README.md | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b6c1e0f..dd1b9c7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,25 +5,33 @@ name: Go on: push: - branches: ["master"] - tags: - - 'v*' pull_request: - branches: ["master"] + types: + - opened + - edited permissions: contents: write jobs: - create_tag: + build: runs-on: ubuntu-latest - outputs: - release_id: ${{ steps.create_release.outputs.id }} steps: - uses: actions/checkout@v3 - run: go mod tidy + - run: go build - run: go test -v ./... continue-on-error: true + # temporarily continue even if unit tests fail + + create_tag: + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/master' +# outputs: +# release_id: ${{ steps.create_release.outputs.id }} + steps: + - uses: actions/checkout@v3 - name: Bump release version and push tag id: release uses: anothrNick/github-tag-action@1.64.0 # Don't use @master or @v1 unless you're happy to test the latest version @@ -41,7 +49,6 @@ jobs: - name: create release id: create_release uses: ncipollo/release-action@v1 - if: success() && !startsWith(github.ref, 'refs/tags/v') with: token: "${{ secrets.GITHUB_TOKEN }}" tag: ${{ steps.tag.outputs.tag_name }} @@ -52,6 +59,7 @@ jobs: goreleaser: needs: create_tag runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' steps: - name: Checkout uses: actions/checkout@v4 @@ -63,7 +71,6 @@ jobs: go-version-file: go.mod - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 - if: success() && startsWith(github.ref, 'refs/tags/v') with: # either 'goreleaser' (default) or 'goreleaser-pro' distribution: goreleaser diff --git a/.gitignore b/.gitignore index 405aac9..b82a2b5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .idea/* *.iml *.ipr +dist \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a8c4383..11cabb2 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,4 +1,4 @@ -project_name: example +project_name: samora-lang builds: - env: [CGO_ENABLED=0] goos: diff --git a/README.md b/README.md index ff18b6c..fa9d836 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Samora Lang is a simple and expressive programming language designed just for fu To get started with Samora Lang, follow these steps: -1. Install the Samora Lang compiler and interpreter. +1. Install the Samora Lang compiler and interpreter from the binary corresponding to your OS Architecture. ### Arch Linux Using the Arch User Repository