mirror of
https://github.com/Jguer/yay
synced 2024-10-05 23:59:13 +00:00
fix(release): auto-tag and build
This commit is contained in:
parent
a9b74a0e1e
commit
b242d0ac4b
12
.github/workflows/docker-ci.yml
vendored
12
.github/workflows/docker-ci.yml
vendored
|
@ -6,7 +6,6 @@ on:
|
|||
- 'doc/**'
|
||||
- 'README.md'
|
||||
- '.gitignore'
|
||||
- 'CHANGELOG.md'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
@ -23,14 +22,3 @@ jobs:
|
|||
with:
|
||||
name: yay_release
|
||||
path: artifacts
|
||||
tag:
|
||||
if: contains(github.ref, 'master')
|
||||
name: Tag release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: mathieudutour/github-tag-action@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag_prefix: 'v'
|
||||
create_annotated_tag: true
|
||||
|
|
28
.github/workflows/docker-multiarch-tag.yml
vendored
28
.github/workflows/docker-multiarch-tag.yml
vendored
|
@ -1,8 +1,9 @@
|
|||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v**
|
||||
branches:
|
||||
- master
|
||||
|
||||
|
||||
jobs:
|
||||
build-releases:
|
||||
|
@ -13,10 +14,16 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@master
|
||||
uses: actions/checkout@v1
|
||||
- name: Tag version
|
||||
uses: mathieudutour/github-tag-action@v3
|
||||
id: tag_version
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag_prefix: 'v'
|
||||
- name: Set version
|
||||
id: set_version
|
||||
run: ./testdata/ci/version.sh
|
||||
run: ./testdata/ci/version.sh ${{ steps.tag_version.outputs.previous_tag }} ${{ steps.tag_version.outputs.new_tag }}
|
||||
- name: Install dependencies
|
||||
run: sudo apt update -y && sudo apt install -y qemu qemu-user-static
|
||||
- name: Setup qemu-user-static
|
||||
|
@ -30,16 +37,11 @@ jobs:
|
|||
with:
|
||||
name: yay_${{ matrix.arch }}
|
||||
path: artifacts
|
||||
create_release:
|
||||
name: Create release from this build
|
||||
needs: [build-releases]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@master
|
||||
- name: Set version
|
||||
id: set_version
|
||||
run: ./testdata/ci/version.sh
|
||||
run: ./testdata/ci/version.sh ${{ steps.tag_version.outputs.previous_tag }} ${{ steps.tag_version.outputs.new_tag }}
|
||||
- uses: actions/download-artifact@master
|
||||
with:
|
||||
name: yay_x86_64
|
||||
|
@ -57,8 +59,10 @@ jobs:
|
|||
with:
|
||||
tag_name: ${{ steps.set_version.outputs.version }}
|
||||
release_name: ${{ steps.set_version.outputs.version }}
|
||||
body: "## Changelog"
|
||||
draft: true
|
||||
body: |
|
||||
## Changelog
|
||||
${{ steps.set_version.outputs.changelog }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Upload x86_64 asset
|
||||
id: upload-release-asset-x86_64
|
||||
|
|
10
testdata/ci/version.sh
vendored
10
testdata/ci/version.sh
vendored
|
@ -1,7 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
if git describe --tags --exact-match ; then
|
||||
echo "::set-output name=VERSION::$(git describe --tags --exact-match | sed 's/^v//g')"
|
||||
else
|
||||
echo "::set-output name=VERSION::$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')"
|
||||
echo "::set-output name=CHANGELOG::$(git log --pretty=format:'%s%n%b==============================================' --abbrev-commit $1..$2)"
|
||||
|
||||
if git describe --tags --exact-match; then
|
||||
echo "::set-output name=VERSION::$(git describe --tags --exact-match | sed 's/^v//g')"
|
||||
else
|
||||
echo "::set-output name=VERSION::$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue