2020-06-13 23:20:22 +02:00
|
|
|
name: Build Release
|
2019-10-16 04:04:01 +02:00
|
|
|
on:
|
|
|
|
push:
|
2020-06-13 23:20:22 +02:00
|
|
|
tags:
|
|
|
|
- v*
|
2020-01-12 17:40:43 +01:00
|
|
|
|
2019-10-16 03:44:10 +02:00
|
|
|
jobs:
|
|
|
|
build-releases:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-11-17 16:21:44 +01:00
|
|
|
arch:
|
|
|
|
[
|
|
|
|
"linux/amd64 x86_64",
|
|
|
|
"linux/arm/v7 armv7h",
|
|
|
|
"linux/arm64 aarch64",
|
|
|
|
]
|
2019-10-16 03:44:10 +02:00
|
|
|
name: Build ${{ matrix.arch }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2020-05-02 10:27:28 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-11-17 16:21:44 +01:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
with:
|
|
|
|
platforms: all
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
version: latest
|
2020-01-12 18:05:56 +01:00
|
|
|
- name: Read info
|
|
|
|
id: tags
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-06-13 23:32:58 +02:00
|
|
|
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
|
|
|
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
|
2020-11-17 16:21:44 +01:00
|
|
|
arch="${{ matrix.arch }}"
|
|
|
|
echo ::set-output name=PLATFORM::${arch%% *}
|
|
|
|
echo ::set-output name=ARCH::${arch##* }
|
2019-10-16 03:44:10 +02:00
|
|
|
- name: Build ${{ matrix.arch }} release
|
|
|
|
run: |
|
|
|
|
mkdir artifacts
|
2020-11-17 16:21:44 +01:00
|
|
|
docker buildx build --platform ${{ steps.tags.outputs.platform }} \
|
|
|
|
--build-arg VERSION=${{ steps.tags.outputs.version }} \
|
|
|
|
--build-arg ARCH=${{ steps.tags.outputs.arch }} \
|
|
|
|
--build-arg PREFIX="/usr" \
|
|
|
|
-t yay:${{ steps.tags.outputs.arch }} . --load
|
|
|
|
make docker-release ARCH=${{ steps.tags.outputs.arch }} VERSION=${{ steps.tags.outputs.version }} PREFIX="/usr"
|
2019-10-16 03:44:10 +02:00
|
|
|
mv *.tar.gz artifacts
|
2020-06-13 23:20:22 +02:00
|
|
|
- uses: actions/upload-artifact@v2
|
2019-10-16 03:44:10 +02:00
|
|
|
with:
|
2020-11-17 16:21:44 +01:00
|
|
|
name: yay_${{ steps.tags.outputs.arch }}
|
2019-10-16 03:44:10 +02:00
|
|
|
path: artifacts
|
2020-01-12 18:05:56 +01:00
|
|
|
create_release:
|
|
|
|
name: Create release from this build
|
|
|
|
needs: [build-releases]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-05-08 00:38:32 +02:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-01-12 18:05:56 +01:00
|
|
|
- name: Read info
|
|
|
|
id: tags
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-06-13 23:32:58 +02:00
|
|
|
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
|
|
|
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
|
2020-05-02 10:27:28 +02:00
|
|
|
- uses: actions/download-artifact@v2
|
2019-10-16 03:44:10 +02:00
|
|
|
with:
|
|
|
|
name: yay_x86_64
|
2020-05-02 10:27:28 +02:00
|
|
|
- uses: actions/download-artifact@v2
|
2019-10-16 03:44:10 +02:00
|
|
|
with:
|
|
|
|
name: yay_armv7h
|
2020-05-02 10:27:28 +02:00
|
|
|
- uses: actions/download-artifact@v2
|
2019-10-16 03:44:10 +02:00
|
|
|
with:
|
|
|
|
name: yay_aarch64
|
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@master
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2020-01-12 19:08:10 +01:00
|
|
|
tag_name: ${{ steps.tags.outputs.tag }}
|
|
|
|
release_name: ${{ steps.tags.outputs.tag }}
|
2020-01-12 17:40:43 +01:00
|
|
|
draft: false
|
2019-10-16 03:44:10 +02:00
|
|
|
prerelease: false
|
|
|
|
- name: Upload x86_64 asset
|
|
|
|
id: upload-release-asset-x86_64
|
2020-05-02 10:27:28 +02:00
|
|
|
uses: actions/upload-release-asset@v1
|
2019-10-16 03:44:10 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2020-05-02 10:27:28 +02:00
|
|
|
asset_path: ./yay_${{ steps.tags.outputs.version }}_x86_64.tar.gz
|
2020-01-12 18:05:56 +01:00
|
|
|
asset_name: yay_${{ steps.tags.outputs.version }}_x86_64.tar.gz
|
2019-10-16 03:44:10 +02:00
|
|
|
asset_content_type: application/tar+gzip
|
|
|
|
- name: Upload armv7h asset
|
|
|
|
id: upload-release-asset-armv7h
|
2020-05-02 10:27:28 +02:00
|
|
|
uses: actions/upload-release-asset@v1
|
2019-10-16 03:44:10 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2020-05-02 10:27:28 +02:00
|
|
|
asset_path: ./yay_${{ steps.tags.outputs.version }}_armv7h.tar.gz
|
2020-01-12 18:05:56 +01:00
|
|
|
asset_name: yay_${{ steps.tags.outputs.version }}_armv7h.tar.gz
|
2019-10-16 03:44:10 +02:00
|
|
|
asset_content_type: application/tar+gzip
|
|
|
|
- name: Upload aarch64 asset
|
|
|
|
id: upload-release-asset-aarch64
|
2020-05-02 10:27:28 +02:00
|
|
|
uses: actions/upload-release-asset@v1
|
2019-10-16 03:44:10 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2020-05-02 10:27:28 +02:00
|
|
|
asset_path: ./yay_${{ steps.tags.outputs.version }}_aarch64.tar.gz
|
2020-01-12 18:05:56 +01:00
|
|
|
asset_name: yay_${{ steps.tags.outputs.version }}_aarch64.tar.gz
|
2019-10-16 03:44:10 +02:00
|
|
|
asset_content_type: application/tar+gzip
|
2020-10-16 13:12:22 +02:00
|
|
|
- name: Release Notary Action
|
2021-05-08 00:38:32 +02:00
|
|
|
uses: docker://aevea/release-notary:0.9.3
|
2021-01-29 22:48:05 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|