Rename .versions
to .version
#9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
strategy: | |
matrix: | |
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: Load version | |
id: version | |
run: | | |
source .version | |
echo "TAGLIB_VERSION=$TAGLIB_VERSION" >> $GITHUB_ENV | |
echo "TAGLIB_SHA=$TAGLIB_SHA" >> $GITHUB_ENV | |
- name: Build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: ${{ matrix.platform }} | |
outputs: | | |
type=local,dest=./output | |
target: artifact | |
build-args: | | |
TAGLIB_VERSION=${{ env.TAGLIB_VERSION }} | |
TAGLIB_SHA=${{ env.TAGLIB_SHA }} | |
- name: Sanitize platform name | |
id: set-platform | |
run: | | |
PLATFORM=$(echo ${{ matrix.platform }} | tr '/' '-') | |
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV | |
- name: Create artifact | |
id: create-artifact | |
run: | | |
mkdir -p ./dist | |
tar -czf ./dist/taglib-${{ env.PLATFORM }}.tar.gz -C ./output . | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PLATFORM }} | |
path: ./dist | |
retention-days: 7 | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./dist | |
merge-multiple: true | |
- run: ls -lR ./dist | |
- name: Generate checksums | |
run: | | |
cd ./dist | |
sha256sum * > checksums.txt | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ./dist/* | |
generate_release_notes: true | |
make_latest: true |