Update release script

This commit is contained in:
Anton Medvedev 2022-04-25 16:22:42 +02:00
parent 3b0826c3c9
commit e3ca218491
4 changed files with 28 additions and 11 deletions

View File

@ -8,8 +8,6 @@ let goarch = [
'arm64', 'arm64',
] ]
await $`go test ./...`
let name = (GOOS, GOARCH) => `fx_${GOOS}_${GOARCH}` + (GOOS === 'windows' ? '.exe' : '') let name = (GOOS, GOARCH) => `fx_${GOOS}_${GOARCH}` + (GOOS === 'windows' ? '.exe' : '')
await Promise.all( await Promise.all(

View File

@ -6,7 +6,6 @@ on:
- created - created
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -17,11 +16,35 @@ jobs:
with: with:
go-version: 1.18 go-version: 1.18
- name: Version - name: Get Version
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Build and Release - name: Update Version
shell: bash
run: |
set -x
sed -i "s/version = .*/version = \"${RELEASE_VERSION}\"/" version.go
sed -i "s/version: .*/version: ${RELEASE_VERSION}/" snap/snapcraft.yaml
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions"
git commit -m "Release RELEASE_VERSION"
git tag "$RELEASE_VERSION" --force
git push origin "$RELEASE_VERSION" --force
- name: Test
run: go test -v ./...
- name: Release
env: env:
FORCE_COLOR: 3 FORCE_COLOR: 3
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }} GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
run: npx zx .github/workflows/release.mjs run: npx zx .github/workflows/release.mjs
- uses: snapcore/action-build@v1
id: build
- uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{ steps.build.outputs.snap }}
release: stable

View File

@ -7,8 +7,7 @@ on:
branches: [ master ] branches: [ master ]
jobs: jobs:
test:
build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -20,6 +19,3 @@ jobs:
- name: Build - name: Build
run: go build -v ./... run: go build -v ./...
- name: Test
run: go test -v ./...

View File

@ -1,5 +1,5 @@
name: fx name: fx
version: git version: 22.0.0
summary: Terminal JSON viewer summary: Terminal JSON viewer
description: Terminal JSON viewer description: Terminal JSON viewer
base: core18 base: core18