forked from Archives/fx
Update release script
This commit is contained in:
parent
3b0826c3c9
commit
e3ca218491
2
.github/workflows/release.mjs
vendored
2
.github/workflows/release.mjs
vendored
@ -8,8 +8,6 @@ let goarch = [
|
||||
'arm64',
|
||||
]
|
||||
|
||||
await $`go test ./...`
|
||||
|
||||
let name = (GOOS, GOARCH) => `fx_${GOOS}_${GOARCH}` + (GOOS === 'windows' ? '.exe' : '')
|
||||
|
||||
await Promise.all(
|
||||
|
29
.github/workflows/release.yml
vendored
29
.github/workflows/release.yml
vendored
@ -6,7 +6,6 @@ on:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@ -17,11 +16,35 @@ jobs:
|
||||
with:
|
||||
go-version: 1.18
|
||||
|
||||
- name: Version
|
||||
- name: Get Version
|
||||
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:
|
||||
FORCE_COLOR: 3
|
||||
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
|
||||
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
|
||||
|
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -7,8 +7,7 @@ on:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@ -20,6 +19,3 @@ jobs:
|
||||
|
||||
- name: Build
|
||||
run: go build -v ./...
|
||||
|
||||
- name: Test
|
||||
run: go test -v ./...
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: fx
|
||||
version: git
|
||||
version: 22.0.0
|
||||
summary: Terminal JSON viewer
|
||||
description: Terminal JSON viewer
|
||||
base: core18
|
||||
|
Loading…
Reference in New Issue
Block a user