forked from formancehq/numscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from PagoPlus/feat/ci-cd-for-numscript#86b37qfxt
[FEAT] CI/CD for numscript release #86b37qfxt
- Loading branch information
Showing
44 changed files
with
252 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Nix CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
configure: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: set-matrix | ||
run: echo "matrix=$(nixci gh-matrix --systems=x86_64-linux,aarch64-darwin | jq -c .)" >> $GITHUB_OUTPUT | ||
|
||
nix: | ||
runs-on: ${{ matrix.system }} | ||
permissions: | ||
contents: read | ||
needs: configure | ||
strategy: | ||
matrix: ${{ fromJson(needs.configure.outputs.matrix) }} | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
nixci \ | ||
--extra-access-tokens "github.com=${{ secrets.GITHUB_TOKEN }}" \ | ||
build \ | ||
--systems "${{ matrix.system }}" \ | ||
.#default.${{ matrix.subflake}} | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: numscript-wasm-${{ matrix.system }} | ||
path: build/numscript.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,48 @@ | ||
name: release | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
- uses: actions/checkout@v4 | ||
with: | ||
go-version: "1.22" | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
fetch-depth: 0 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
path: /tmp/.cache | ||
key: ${{ runner.os }}-build-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: get deps | ||
run: go mod download | ||
${{ runner.os }}-build- | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.22" | ||
cache: true | ||
|
||
- name: Install TinyGo | ||
run: | | ||
wget -P tmp/ https://github.com/tinygo-org/tinygo/releases/download/v0.34.0/tinygo_0.34.0_amd64.deb | ||
sudo dpkg -i tmp/tinygo_0.34.0_amd64.deb | ||
- name: Get dependencies | ||
run: | | ||
go mod download | ||
go mod verify | ||
- name: Run GoReleaser | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
description = "A Nix flake for NumScript WASM compilation"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
inherit (pkgs.lib) optional optionals; | ||
pkgs = import nixpkgs { inherit system; }; | ||
|
||
inputs = with pkgs; [ | ||
go | ||
tinygo | ||
git | ||
just | ||
] ++ optional stdenv.isLinux inotify-tools | ||
++ optionals stdenv.isDarwin | ||
(with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices ]); | ||
|
||
in with pkgs; { | ||
devShells.default = mkShell { | ||
name = "numscript-wasm"; | ||
packages = inputs; | ||
|
||
shellHook = '' | ||
echo "NumScript WASM development environment" | ||
echo "TinyGo version: $(tinygo version)" | ||
echo "Go version: $(go version)" | ||
''; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.