workflow changes 2
This commit is contained in:
parent
3146a67563
commit
13ad81b30b
|
@ -4,16 +4,29 @@ on: [push, pull_request]
|
|||
|
||||
jobs:
|
||||
|
||||
bump-tag:
|
||||
if: github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
- id: bump_version
|
||||
name: Bump version and push tag
|
||||
uses: anothrNick/github-tag-action@1.46.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
WITH_V: true
|
||||
outputs:
|
||||
new_tag: ${{ steps.bump_version.outputs.new_tag }}
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [gcc]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Ninja
|
||||
uses: ashutoshvarma/setup-ninja@master
|
||||
with:
|
||||
|
@ -38,10 +51,7 @@ jobs:
|
|||
build-macos:
|
||||
runs-on: macos-10.15
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Ninja
|
||||
uses: ashutoshvarma/setup-ninja@master
|
||||
with:
|
||||
|
@ -66,10 +76,7 @@ jobs:
|
|||
matrix:
|
||||
platform: [x86, amd64]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Ninja
|
||||
uses: ashutoshvarma/setup-ninja@master
|
||||
with:
|
||||
|
@ -95,17 +102,10 @@ jobs:
|
|||
|
||||
|
||||
create-release:
|
||||
needs: [build-linux, build-macos, build-windows]
|
||||
needs: [bump-tag, build-linux, build-macos, build-windows]
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Obtain tag version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Fetch build artifacts
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
|
@ -116,7 +116,7 @@ jobs:
|
|||
with:
|
||||
draft: false
|
||||
prerelease: true
|
||||
release_name: ${{ steps.get_version.outputs.VERSION }}
|
||||
release_name: ${{needs.bump-tag.outputs.new_tag}}
|
||||
tag_name: ${{ github.ref }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
@ -127,7 +127,7 @@ jobs:
|
|||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: ./artifacts/linux-amd64.tar.gz
|
||||
asset_name: dethrace-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz
|
||||
asset_name: dethrace-${{needs.bump-tag.outputs.new_tag}}-linux-amd64.tar.gz
|
||||
asset_content_type: application/octet-stream
|
||||
- name: Upload darwin-amd64 artifact
|
||||
uses: actions/upload-release-asset@v1.0.1
|
||||
|
@ -136,7 +136,7 @@ jobs:
|
|||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: ./artifacts/darwin-amd64.tar.gz
|
||||
asset_name: dethrace-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
|
||||
asset_name: dethrace-${{needs.bump-tag.outputs.new_tag}}-darwin-amd64.tar.gz
|
||||
asset_content_type: application/octet-stream
|
||||
- name: Upload windows-x86 artifact
|
||||
uses: actions/upload-release-asset@v1.0.1
|
||||
|
@ -145,7 +145,7 @@ jobs:
|
|||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: ./artifacts/windows-x86.zip
|
||||
asset_name: dethrace-${{ steps.get_version.outputs.VERSION }}-windows-x86.zip
|
||||
asset_name: dethrace-${{needs.bump-tag.outputs.new_tag}}-windows-x86.zip
|
||||
asset_content_type: application/octet-stream
|
||||
- name: Upload windows-amd64 artifact
|
||||
uses: actions/upload-release-asset@v1.0.1
|
||||
|
@ -154,5 +154,5 @@ jobs:
|
|||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: ./artifacts/windows-amd64.zip
|
||||
asset_name: dethrace-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
|
||||
asset_name: dethrace-${{needs.bump-tag.outputs.new_tag}}-windows-amd64.zip
|
||||
asset_content_type: application/octet-stream
|
|
@ -1,20 +1,20 @@
|
|||
name: Bump release tag
|
||||
# name: Bump release tag
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - main
|
||||
|
||||
jobs:
|
||||
tag:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
- name: Bump version and push tag
|
||||
uses: anothrNick/github-tag-action@1.46.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
WITH_V: true
|
||||
# jobs:
|
||||
# tag:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# with:
|
||||
# fetch-depth: '0'
|
||||
# - name: Bump version and push tag
|
||||
# uses: anothrNick/github-tag-action@1.46.0
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# WITH_V: true
|
||||
|
Loading…
Reference in New Issue