Skip to content

Fix a typo :(

Fix a typo :( #41

Workflow file for this run

name: Build and Release
on:
push:
tags:
- "v*"
jobs:
build:
strategy:
matrix:
# os: [linux, windows, darwin]
# arch: [amd64, arm64]
os: [darwin]
arch: [arm64]
runs-on: ubuntu-latest
environment: production
env:
SELF_UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SELF_UPDATE_PRIVATE_KEY: ${{ secrets.SELF_UPDATE_PRIVATE_KEY }}
SELF_UPDATE_PUBLIC_KEY: ${{ secrets.SELF_UPDATE_PUBLIC_KEY }}
SELF_UPDATE_VERSION: ${{ github.ref_name }}
steps:
- name: Setup Go 1.21
uses: actions/setup-go@v3
with:
go-version: ^1.21
- name: Setup Repo
uses: actions/checkout@v3
- name: Install dependencies
run: go mod tidy
- name: Run Unit Tests
run: go test -v ./...
- name: Build temporary cli
run: go build -o ./selfupdate ./cmd/selfupdate/main.go
- name: Create a Release
run: |
./selfupdate github release \
--owner blockthrough \
--repo selfupdate.go \
--version ${{ env.SELF_UPDATE_VERSION }} \
--title ${{ env.SELF_UPDATE_VERSION }} \
--token ${{ env.SELF_UPDATE_GH_TOKEN }}
- name: Build and Sign
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} \
go build \
-ldflags "-X main.Version=${{ env.SELF_UPDATE_VERSION }} -X main.PublicKey=${{ env.SELF_UPDATE_PUBLIC_KEY }}" \
-o ./selfupdate-${{ matrix.os }}-${{ matrix.arch }} \
./cmd/selfupdate/main.go
- name: Upload New Release
run: |
./selfupdate github upload \
--owner blockthrough \
--repo selfupdate.go \
--filename selfupdate-${{ matrix.os }}-${{ matrix.arch }}.sign \
--version ${{ env.SELF_UPDATE_VERSION }} \
--token ${{ env.SELF_UPDATE_GH_TOKEN }} \
--key ${{ env.SELF_UPDATE_PRIVATE_KEY }} < ./selfupdate-${{ matrix.os }}-${{ matrix.arch }}