Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add github actions #2

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/on-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: build

permissions: read-all

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
env:
GO_VERSION: '1.22.4'
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: install go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: build
run: make build-cross
41 changes: 41 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: release

permissions: read-all

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
env:
GO_VERSION: '1.22.4'
NODE_VERSION: '20'
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: install go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: build
run: make build-cross
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ bin
target
.bash_profile
_dist
package-lock.json
node_modules
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ clean-dist:
@rm -rf $(DIST_DIR)

.PHONY: build-cross
build-cross: clean-dist darwin-arm64 darwin-amd64 linux-amd64
build-cross: clean-dist go-cache darwin-arm64 darwin-amd64 linux-amd64

.PHONY: dist
dist: build-cross
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/belitre/canu

go 1.22.1
go 1.22.4

require (
github.com/aws/aws-sdk-go-v2 v1.27.1
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"devDependencies": {
"@semantic-release/exec": "^6.0.3",
"conventional-changelog-conventionalcommits": "^8.0.0",
"semantic-release": "^24.0.0"
}
}