Skip to content

Commit

Permalink
wip: add goreleaser in the workflow
Browse files Browse the repository at this point in the history
execute git hub actions on any push or PR
only create release from master
  • Loading branch information
snhane committed Oct 26, 2023
1 parent 03f45c2 commit acdfbab
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea/*
*.iml
*.ipr
dist
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project_name: example
project_name: samora-lang
builds:
- env: [CGO_ENABLED=0]
goos:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit acdfbab

Please sign in to comment.