[change] action workflow & dockerfile

This commit is contained in:
Max 2023-04-01 09:26:18 +08:00
parent f5e9920dbc
commit c062c6f8ee
7 changed files with 15 additions and 9 deletions

View file

@ -22,7 +22,7 @@ jobs:
- name: Get Version - name: Get Version
run: | run: |
echo VERSION=$(cat share/const.go |grep 'const VERSION' | awk '{print $4}' | sed "s/\"//g") >> $GITHUB_ENV echo VERSION=$(cat share/const.go |grep 'const VERSION' | awk '{print $4}' | sed "s/\"//g")-dev >> $GITHUB_ENV
- name: Check Version - name: Check Version
run: echo $VERSION run: echo $VERSION

View file

@ -6,7 +6,7 @@ on:
tags: tags:
description: "Version tags" description: "Version tags"
push: push:
branches: [main] branches: [v0.10.3-dev]
paths: paths:
- "share/const.go" - "share/const.go"
@ -108,6 +108,8 @@ jobs:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
ref: v0.10.3-dev
- name: Setup Go ${{ matrix.go }} - name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v3 uses: actions/setup-go@v3

View file

@ -6,7 +6,7 @@ on:
tags: tags:
description: "Version tags" description: "Version tags"
push: push:
branches: [main] branches: [v0.10.3-dev]
paths: paths:
- "share/const.go" - "share/const.go"
@ -105,6 +105,8 @@ jobs:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
ref: v0.10.3-dev
- name: Setup Go ${{ matrix.go }} - name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v3 uses: actions/setup-go@v3

View file

@ -4,9 +4,9 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
tags: tags:
description: "Comment" description: "Version"
push: push:
branches: [main] branches: [v0.10.3-dev]
env: env:
YAO_DEV: ${{ github.WORKSPACE }} YAO_DEV: ${{ github.WORKSPACE }}
@ -133,6 +133,8 @@ jobs:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
ref: v0.10.3-dev
- name: Start Redis - name: Start Redis
uses: supercharge/redis-github-action@1.4.0 uses: supercharge/redis-github-action@1.4.0

View file

@ -174,7 +174,7 @@ artifacts-linux: clean
mv dist/yao-*-* dist/release/ mv dist/yao-*-* dist/release/
chmod +x dist/release/yao-*-* chmod +x dist/release/yao-*-*
ls -l dist/release/ ls -l dist/release/
dist/release/yao-${VERSION}-linux-amd64 version dist/release/yao-${VERSION}-dev-linux-amd64 version
# Reset const # Reset const
# cp -f share/const.goe share/const.go # cp -f share/const.goe share/const.go
@ -224,7 +224,7 @@ artifacts-macos: clean
mv dist/yao-*-* dist/release/ mv dist/yao-*-* dist/release/
chmod +x dist/release/yao-*-* chmod +x dist/release/yao-*-*
ls -l dist/release/ ls -l dist/release/
dist/release/yao-${VERSION}-darwin-amd64 version dist/release/yao-${VERSION}-dev-darwin-amd64 version
# Reset const # Reset const
# cp -f share/const.goe share/const.go # cp -f share/const.goe share/const.go

View file

@ -20,7 +20,7 @@ ARG ARCH
RUN groupadd -r yao && useradd -r -g yao yao && \ RUN groupadd -r yao && useradd -r -g yao yao && \
apt-get update && \ apt-get update && \
apt-get install -y curl sudo procps net-tools apt-get install -y curl sudo procps net-tools
RUN curl -fsSL "https://release-sv-1252011659.cos.na-siliconvalley.myqcloud.com/archives/yao-${VERSION}-linux-${ARCH}" > /usr/local/bin/yao && \ RUN curl -fsSL "https://release-sv-1252011659.cos.na-siliconvalley.myqcloud.com/archives/yao-${VERSION}-dev-linux-${ARCH}" > /usr/local/bin/yao && \
chmod +x /usr/local/bin/yao && \ chmod +x /usr/local/bin/yao && \
mkdir -p /data/app mkdir -p /data/app

View file

@ -18,7 +18,7 @@ FROM alpine:latest
ARG VERSION ARG VERSION
ARG ARCH ARG ARCH
RUN apk --no-cache add curl RUN apk --no-cache add curl
RUN curl -fsSL "https://release-sv-1252011659.cos.na-siliconvalley.myqcloud.com/archives/yao-${VERSION}-linux-${ARCH}" > /usr/local/bin/yao && \ RUN curl -fsSL "https://release-sv-1252011659.cos.na-siliconvalley.myqcloud.com/archives/yao-${VERSION}-dev-linux-${ARCH}" > /usr/local/bin/yao && \
chmod +x /usr/local/bin/yao chmod +x /usr/local/bin/yao
RUN mkdir -p /data/app RUN mkdir -p /data/app
VOLUME /data/app VOLUME /data/app