mirror of
https://github.com/Jguer/yay
synced 2024-07-18 08:23:32 +00:00
fix(ci): refactor CI
This commit is contained in:
parent
d003e96e07
commit
d3f9335d2d
|
@ -1,50 +1,25 @@
|
|||
name: Release
|
||||
name: Build Release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
tag:
|
||||
name: Tag release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: mathieudutour/github-tag-action@v4.5
|
||||
id: tag_version
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag_prefix: "v"
|
||||
create_annotated_tag: true
|
||||
- name: share variables
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir env
|
||||
echo ${{ steps.tag_version.outputs.new_version }} > env/new_version
|
||||
echo ${{ steps.tag_version.outputs.new_tag }} > env/new_tag
|
||||
echo "${{ steps.tag_version.outputs.changelog }}" > env/changelog
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: env
|
||||
path: env
|
||||
build-releases:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ["x86_64", "armv7h", "aarch64"]
|
||||
name: Build ${{ matrix.arch }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: [tag]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: env
|
||||
- name: Read info
|
||||
id: tags
|
||||
shell: bash
|
||||
run: |
|
||||
echo ::set-output name=VERSION::$(cat new_version)
|
||||
echo ::set-output name=VERSION::${GITHUB_REF#/refs/tags/v}
|
||||
echo ::set-output name=TAG::${GITHUB_REF#/refs/tags/}
|
||||
- name: Install dependencies
|
||||
run: sudo apt update -y && sudo apt install -y qemu qemu-user-static
|
||||
- name: Setup qemu-user-static
|
||||
|
@ -54,7 +29,7 @@ jobs:
|
|||
mkdir artifacts
|
||||
make docker-release-${{ matrix.arch }} ARCH=${{ matrix.arch }} VERSION=${{ steps.tags.outputs.version }}
|
||||
mv *.tar.gz artifacts
|
||||
- uses: actions/upload-artifact@master
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: yay_${{ matrix.arch }}
|
||||
path: artifacts
|
||||
|
@ -63,18 +38,17 @@ jobs:
|
|||
needs: [build-releases]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: env
|
||||
- name: Read info
|
||||
id: tags
|
||||
shell: bash
|
||||
run: |
|
||||
echo ::set-output name=VERSION::$(cat new_version)
|
||||
echo ::set-output name=TAG::$(cat new_tag)
|
||||
echo ::set-output name=CHANGELOG::$(cat changelog)
|
||||
echo ::set-output name=VERSION::${GITHUB_REF#/refs/tags/v}
|
||||
echo ::set-output name=TAG::${GITHUB_REF#/refs/tags/}
|
||||
- name: Changelog
|
||||
uses: scottbrenner/generate-changelog-action@master
|
||||
id: changelog
|
||||
env:
|
||||
REPO: ${{ github.repository }}
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: yay_x86_64
|
||||
|
@ -92,7 +66,8 @@ jobs:
|
|||
with:
|
||||
tag_name: ${{ steps.tags.outputs.tag }}
|
||||
release_name: ${{ steps.tags.outputs.tag }}
|
||||
body: ${{ steps.tags.outputs.changelog }}
|
||||
body: |
|
||||
${{ steps.changelog.outputs.changelog }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Upload x86_64 asset
|
17
.github/workflows/tag.yml
vendored
Normal file
17
.github/workflows/tag.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
name: Tag
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
tag:
|
||||
name: Tag release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: mathieudutour/github-tag-action@v4.5
|
||||
id: tag_version
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag_prefix: "v"
|
|
@ -6,6 +6,8 @@ on:
|
|||
- "doc/**"
|
||||
- "README.md"
|
||||
- ".gitignore"
|
||||
branches-ignore:
|
||||
- "master"
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
@ -26,6 +28,6 @@ jobs:
|
|||
- name: Run Build and tests
|
||||
run: |
|
||||
pacman -Sy --noconfirm go
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.26.0
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.27.0
|
||||
./bin/golangci-lint run ./...
|
||||
make test
|
Loading…
Reference in a new issue