Browse Source

fix release version

pull/290/head
yedf2 4 years ago
parent
commit
fd81ac8f0e
  1. 13
      .github/workflows/release.yml
  2. 6
      helper/.goreleaser.yml

13
.github/workflows/release.yml

@ -9,6 +9,12 @@ jobs:
name: Release on GitHub name: Release on GitHub
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Get Release Version
run: |
export RELEASE_VERSION=${GITHUB_REF#refs/*/}
echo RELEASE_VERSION: ${RELEASE_VERSION}
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
- name: Check out code - name: Check out code
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -25,7 +31,7 @@ jobs:
cd admin cd admin
npm install -g yarn npm install -g yarn
yarn yarn
VITE_ADMIN_VERSION=${GITHUB_REF#refs/*/} yarn build VITE_ADMIN_VERSION=${{ env.RELEASE_VERSION }} yarn build
echo "${{secrets.DEPLOY_KEY}}" > deploy_key echo "${{secrets.DEPLOY_KEY}}" > deploy_key
chmod 600 ./deploy_key chmod 600 ./deploy_key
tar -cvzf dist.tar.gz dist tar -cvzf dist.tar.gz dist
@ -47,7 +53,7 @@ jobs:
env: env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Docker meta - name: Create Docker
id: meta id: meta
uses: docker/metadata-action@v3 uses: docker/metadata-action@v3
with: with:
@ -71,9 +77,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:

6
helper/.goreleaser.yml

@ -12,9 +12,9 @@ builds:
dir: . dir: .
main: main.go main: main.go
ldflags: ldflags:
- -s -w -X main.Version={{.Version}} - -s -w -X main.Version=v{{.Version}}
- id: dtm_arm64 - id: dtm_arm64
env: [ CGO_ENABLED=0 ] env: [CGO_ENABLED=0]
goos: goos:
- darwin - darwin
goarch: goarch:
@ -22,4 +22,4 @@ builds:
dir: . dir: .
main: main.go main: main.go
ldflags: ldflags:
- -s -w -X main.Version={{.Version}} - -s -w -X main.Version=v{{.Version}}

Loading…
Cancel
Save