Skip to content

Commit

Permalink
Add workflow to build and release (#1)
Browse files Browse the repository at this point in the history
* Create docker-image.yml

* fix

* fix

* fix

* fix

* fix

* fix

* all platforms

* No tags needed

* Release
  • Loading branch information
deluan authored Oct 10, 2024
1 parent d8de8f6 commit 41de281
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Docker Image CI

on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main

jobs:
build:
strategy:
matrix:
# platform: [ linux/amd64, linux/arm64 ]
platform: [ linux/amd64, linux/arm64, linux/arm/v5, linux/arm/v6, linux/arm/v7, linux/386, darwin/amd64, darwin/arm64, windows/amd64, windows/386 ]
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- uses: actions/checkout@v4

# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Extract metadata for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# labels: |
# maintainer=deluan
# images: |
# name=ghcr.io/${{ github.repository }}
# tags: |
# type=semver,pattern={{version}}

- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: ${{ matrix.platform }}
# push: true
outputs: |
type=local,dest=./dist
target: artifact
# tags: ${{ steps.meta.outputs.tags }}
build-args: |
TAGLIB_VERSION=2.0.2
TAGLIB_SHA=e3de03501ff66221d1f1f971022b248d5b38ba06
RELEASE_VERSION=0
- name: Set filename
id: set-filename
run: |
PLATFORM=$(echo ${{ matrix.platform }} | tr '/' '-')
echo "filename=taglib-2.0.2-1-$PLATFORM.zip" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: ${{ env.filename }}
path: ./dist
retention-days: 7

release:
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: ./dist
pattern: taglib-*
merge-multiple: true

- name: Generate checksums
run: |
cd ./dist
sha256sum * > checksums.txt
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ./dist/*

0 comments on commit 41de281

Please sign in to comment.