1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

View File

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