mirror of
https://github.com/meehow/privtracker.git
synced 2026-09-02 22:56:07 +08:00
automate goreleaser
This commit is contained in:
31
.github/workflows/docker-build-push.yml
vendored
31
.github/workflows/docker-build-push.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: Docker Build & Push (Tags Only)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '[0-9]*' # triggers for version tag pushed
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Step 1: Check out the repository
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Step 2: Log in to Docker Hub
|
||||
- name: Log in to Docker Hub
|
||||
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u meehow --password-stdin
|
||||
|
||||
# Step 3: Build the Docker image
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t meehow/privtracker:latest \
|
||||
-t meehow/privtracker:${{ github.ref_name }} .
|
||||
|
||||
# Step 4: Push the Docker image
|
||||
- name: Push Docker image
|
||||
run: |
|
||||
docker push meehow/privtracker:latest
|
||||
docker push meehow/privtracker:${{ github.ref_name }}
|
||||
40
.github/workflows/release.yml
vendored
Normal file
40
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '[0-9]*' # triggers for version tag pushed
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: meehow
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags:
|
||||
- meehow/privtracker:latest
|
||||
- meehow/privtracker:${{ github.ref_name }}
|
||||
@@ -25,6 +25,8 @@ builds:
|
||||
ignore:
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
flags: -trimpath
|
||||
ldflags: -s -w -buildid=
|
||||
|
||||
archives:
|
||||
- formats: tar.gz
|
||||
@@ -50,4 +52,4 @@ changelog:
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
- "_test:"
|
||||
|
||||
Reference in New Issue
Block a user