From 7392fada2c308d5ce255fba904879d2520521b34 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 30 Apr 2024 13:24:11 -0700 Subject: [PATCH] Intermittent updates --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ .goreleaser.yaml | 41 +++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..eb7d11b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release' + required: true + +defaults: + run: + shell: bash + +permissions: {} + +jobs: + build: + name: Build (${{ matrix.os }}/${{ matrix.arch }}) + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - runner: ubuntu-latest + os: Linux + arch: X64 + - runner: macos-13 + os: macOS + arch: X64 + - runner: macos-14 + os: macOS + arch: ARM64 + steps: + - env: + OS: ${{ matrix.os }} + ARCH: ${{ matrix.arch }} + run: | + if [[ "$OS" != "$RUNNER_OS" || "$ARCH" != "$RUNNER_ARCH" ]]; then + echo "::error title=Unexpected Runner::Expected $OS/$ARCH, got $RUNNER_OS/$RUNNER_ARCH" + exit 1 + fi + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.22.2 + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... + + - name: Upload release artifact + uses: actions/upload-artifact@v4 + with: + name: lotus-${{ matrix.os }}-${{ matrix.arch }} + path: glif \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6d7d3aa..9c2751f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ cli glif keys.toml + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..62f6c4d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,41 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 1 + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... + +builds: + - env: + - CGO_ENABLED=0 + goos: + # - linux + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:"