Skip to content

Bump version to 0.1.1 #4

Bump version to 0.1.1

Bump version to 0.1.1 #4

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
binary: oc-usage-linux-amd64
- os: macos-latest
goos: darwin
goarch: arm64
binary: oc-usage-darwin-arm64
- os: windows-latest
goos: windows
goarch: amd64
binary: oc-usage-windows-amd64.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Build
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
cd opencode-usage
go build -ldflags="-s -w" -o ../${{ matrix.binary }} .
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.binary }}
path: ${{ matrix.binary }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: oc-usage ${{ github.ref_name }}
files: artifacts/*
publish-npm:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
run: cd npm && npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}