Skip to content

✨ v4.5.1

✨ v4.5.1 #21

Workflow file for this run

name: build and releases
on:
workflow_dispatch:
push:
# run only against tags
tags:
- '*'
jobs:
go-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get the tag
run: echo "The tag is ${{ github.ref_name }}"
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: true
- name: fix embeded
run: |
go env
mkdir ./preconfigs/embeded/miaokoCA
echo "${{ secrets.MIAOSPEED_CRT }}" > ./preconfigs/embeded/miaokoCA/miaoko.crt
echo "${{ secrets.MIAOSPEED_KEY }}" > ./preconfigs/embeded/miaokoCA/miaoko.key
echo "${{ secrets.MS_BUILDTOKEN }}" > ./utils/embeded/BUILDTOKEN.key
curl -o ./engine/embeded/default_geoip.js ${{ secrets.DEFAULT_GEOIP }}
head -n 5 ./engine/embeded/default_geoip.js
- name: build
run: make releases
- name: Release
uses: softprops/action-gh-release@v2
with:
files: ./bin/*
body_path: './CHANGELOG.md'
tag_name: ${{ github.ref_name }}
- name: Get the tag
run: |
echo "MIAOSPEED_TAG=$(curl -s https://api.github.com/repos/AirportR/miaospeed/releases/latest | grep 'tag_name' | cut -d '"' -f 4)" >> $GITHUB_ENV
echo "The tag is ${{ github.ref_name }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/miaospeed:${{ env.MIAOSPEED_TAG }}
${{ secrets.DOCKERHUB_USERNAME }}/miaospeed:latest
platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8
- name: Logout from Docker Hub
run: docker logout