Compare commits

..

16 Commits

Author SHA1 Message Date
4323eb79f3 Update Makefile 2022-05-01 21:55:58 +08:00
2c7ae8753d Update release.yaml 2022-05-01 21:50:08 +08:00
8438cade99 chore: docker 2022-05-01 21:22:41 +08:00
9cc14b80b9 chore: workflow 2022-05-01 13:25:04 +08:00
85410e1f25 chore: workflow 2022-05-01 13:22:38 +08:00
6fce893428 chore: workflow 2022-05-01 13:22:02 +08:00
2dd7a87f4c chore: modify makefile 2022-05-01 13:22:02 +08:00
c6d1b7aff4 chore: modify github workflows 2022-05-01 13:22:02 +08:00
dc0dc1cfe1 chore: modify github workflows 2022-05-01 13:22:02 +08:00
e0bec5ad2b chore: modify github workflows 2022-05-01 13:22:02 +08:00
d7e63975b9 Update prerelease.yml 2022-05-01 12:14:36 +08:00
394a297368 chore: modify github workflows 2022-05-01 11:58:06 +08:00
10a9eab542 chore: modify github workflows 2022-05-01 11:56:45 +08:00
368a44ff73 chore: modify github workflows 2022-05-01 11:18:11 +08:00
4209aa6738 chore: modify github workflows 2022-05-01 11:16:02 +08:00
e22053ce2c fix: test error 2022-05-01 10:42:11 +08:00
5 changed files with 17 additions and 16 deletions

View File

@ -6,8 +6,11 @@ on:
- Beta
tags:
- "v*"
env:
REGISTRY: docker.io
IMAGE_NAME: '{{ env.DOCKERHUB_ACCOUNT }}/{{ env.DOCKERHUB_REPO }}'
jobs:
build:
runs-on: ubuntu-latest
@ -34,15 +37,15 @@ jobs:
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ secrets.DOCKERHUB_ACCOUNT }}/${{secrets.DOCKERHUB_REPO}}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Log into registry
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
@ -51,7 +54,6 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
platforms: |
linux/386

View File

@ -1,4 +1,4 @@
name: Prerelease
name: prerelease
on:
push:
branches:
@ -31,13 +31,10 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
if: ${{env.GITHUB_REF_NAME=='Beta'}}
run: |
go test ./...
- name: Build
if: success()
env:
@ -49,13 +46,13 @@ jobs:
uses: andreaswilli/delete-release-assets-action@v2.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: Prerelease-${{env.GITHUB_REF_NAME}}
tag: ${{ env.GITHUB_REF_NAME }}
deleteOnlyFromDrafts: false
- name: Tag Repo
uses: richardsimko/update-tag@v1
with:
tag_name: Prerelease-${{env.GITHUB_REF_NAME}}
tag_name: ${{env.GITHUB_REF_NAME}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -64,7 +61,7 @@ jobs:
if: ${{ success() }}
with:
tag: ${{env.GITHUB_REF_NAME}}
tag_name: Prerelease-${{env.GITHUB_REF_NAME}}
tag_name: ${{env.GITHUB_REF_NAME}}
files: bin/*
prerelease: true
generate_release_notes: true

View File

@ -1,4 +1,4 @@
name: Release
name: release
on:
push:
tags:

View File

@ -1,11 +1,13 @@
FROM golang:alpine as builder
ARG TARGETOS
ARG TARGETARCH
RUN apk add --no-cache make git && \
mkdir /clash-config && \
wget -O /clash-config/Country.mmdb https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb && \
wget -O /clash-config/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat && \
wget -O /clash-config/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
wget -O /clash-config/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat \
COPY . /clash-src
WORKDIR /clash-src

View File

@ -1,6 +1,6 @@
NAME=Clash.Meta
BINDIR=bin
BRANCH=$(shell git branch --show-current)
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
ifeq ($(BRANCH),Alpha)
VERSION=alpha-$(shell git rev-parse --short HEAD)
else ifeq ($(BRANCH),Beta)