ci: automated builds when pushing "weekly.*" tags (#7005)

pull/7009/head
Leah Lundqvist 2020-11-29 02:16:10 +01:00 committed by GitHub
parent a6f1667bce
commit 80c4b8a17a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 143 additions and 135 deletions

View File

@ -1,140 +1,148 @@
name: Build binary artifacts name: Build binary artifacts
on: on:
push: push:
branches: tags:
- main - weekly.**
- master
jobs: jobs:
build-linux: build-linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 strategy:
env: matrix:
CC: gcc compiler: [gcc]
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Compile - name: Compile
run: make env:
## - name: Create artifact CC: ${{ matrix.compiler }}
## uses: actions/upload-artifact@v2 run: make
## with: - name: Create artifact
## name: linux uses: actions/upload-artifact@v2
## path: | with:
## . name: linux
## !./.git path: |
## !./.ctags.d .
## !./.github !./.git
## !./vc !./.ctags.d
## !./v_old !./.github
## - name: Create binary only artifact !./vc
## uses: actions/upload-artifact@v2 !./v_old
## with: - name: Create binary only artifact
## name: linux-binary uses: actions/upload-artifact@v2
## path: ./v with:
## name: linux-binary
## build-macos: path: ./v
## runs-on: macos-latest
## env: build-macos:
## CC: clang runs-on: macos-latest
## steps: strategy:
## - uses: actions/checkout@v1 matrix:
## - name: Compile compiler: [clang]
## run: make steps:
## - name: Create artifact - uses: actions/checkout@v1
## uses: actions/upload-artifact@v2 - name: Compile
## with: env:
## name: macos CC: ${{ matrix.compiler }}
## path: | run: make
## . - name: Create artifact
## !./.git uses: actions/upload-artifact@v2
## !./.ctags.d with:
## !./.github name: macos
## !./vc path: |
## !./v_old .
## - name: Create binary only artifact !./.git
## uses: actions/upload-artifact@v2 !./.ctags.d
## with: !./.github
## name: macos-binary !./vc
## path: ./v !./v_old
## - name: Create binary only artifact
## build-windows: uses: actions/upload-artifact@v2
## runs-on: windows-latest with:
## name: macos-binary
## steps: path: ./v
## - uses: actions/checkout@v1
## - uses: msys2/setup-msys2@v2 build-windows:
## - name: Compile runs-on: windows-latest
## run: ./make.bat steps:
## - name: Create artifact - uses: actions/checkout@v1
## uses: actions/upload-artifact@v2 - uses: msys2/setup-msys2@v2
## with: - name: Compile
## name: windows run: ./make.bat
## path: | - name: Create artifact
## . uses: actions/upload-artifact@v2
## !./.git with:
## !./.ctags.d name: windows
## !./.github path: |
## !./vc .
## !./v_old !./.git
## - name: Create binary only artifact !./.ctags.d
## uses: actions/upload-artifact@v2 !./.github
## with: !./vc
## name: windows-binary !./v_old
## path: ./v.exe - name: Create binary only artifact
## uses: actions/upload-artifact@v2
## release: with:
## name: Create Github Release name: windows-binary
## needs: [build-linux, build-windows, build-macos] path: ./v.exe
## runs-on: ubuntu-latest
## steps: release:
## - name: Remove old tag name: Create Github Release
## uses: dev-drprasad/delete-tag-and-release@v0.1.2 needs: [build-linux, build-windows, build-macos]
## with: runs-on: ubuntu-latest
## delete_release: true steps:
## tag_name: latest-commit - name: Get short tag name
## env: uses: jungwinter/split@v1
## GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} id: split
## - name: Create Release with:
## id: create_release msg: ${{ github.ref }}
## uses: ncipollo/release-action@v1 seperator: /
## with: - name: Create Release
## token: ${{ secrets.GITHUB_TOKEN }} id: create_release
## tag: latest-commit uses: ncipollo/release-action@v1
## name: Prebuilt binaries of the latest commit with:
## commit: ${{ github.sha }} token: ${{ secrets.GITHUB_TOKEN }}
## draft: false tag: ${{ steps.split.outputs._2 }}
## prerelease: true name: ${{ steps.split.outputs._2 }}
## commit: ${{ github.sha }}
## publish: draft: false
## needs: [release] prerelease: false
## runs-on: ubuntu-latest
## strategy: publish:
## matrix: needs: [release]
## version: [linux, macos, windows] runs-on: ubuntu-latest
## steps: strategy:
## - uses: actions/checkout@v1 matrix:
## - name: Fetch artifacts version: [linux, macos, windows]
## uses: actions/download-artifact@v1 steps:
## with: - uses: actions/checkout@v1
## name: ${{ matrix.version }} - name: Fetch artifacts
## path: ./${{ matrix.version }} uses: actions/download-artifact@v1
## - name: Build with:
## run: zip -r ${{ matrix.version }}.zip ./${{ matrix.version }}/* name: ${{ matrix.version }}
## - name: Get release path: ./${{ matrix.version }}
## id: get_release_info - name: Build
## uses: leahlundqvist/get-release@v1.3.1 run: zip -r ${{ matrix.version }}.zip ./${{ matrix.version }}/*
## env: - name: Get short tag name
## GITHUB_TOKEN: ${{ github.token }} uses: jungwinter/split@v1
## with: id: split
## tag_name: latest-commit with:
## - name: Upload Release Asset msg: ${{ github.ref }}
## id: upload-release-asset seperator: /
## uses: actions/upload-release-asset@v1.0.1 - name: Get release
## env: id: get_release_info
## GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} uses: leahlundqvist/get-release@v1.3.1
## with: env:
## upload_url: ${{ steps.get_release_info.outputs.upload_url }} GITHUB_TOKEN: ${{ github.token }}
## asset_path: ./${{ matrix.version }}.zip with:
## asset_name: ${{ matrix.version }}.zip tag_name: ${{ steps.split.outputs._2 }}
## asset_content_type: application/zip - name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./${{ matrix.version }}.zip
asset_name: ${{ matrix.version }}.zip
asset_content_type: application/zip