name: CD
on:
push:
branches:
- main
tags:
- "v?[0-9]+.[0-9]+.[0-9]+*"
permissions:
contents: write
jobs:
build:
name: GitHub artifacts
runs-on: ubuntu-latest
strategy:
matrix:
target:
- i686-linux-gnu
- x86_64-linux-gnu
- aarch64-linux-gnu
- armv6l-linux-gnueabihf
- armv7l-linux-gnueabihf
- powerpc64le-linux-gnu
- x86_64-apple-darwin
- aarch64-apple-darwin
- x86_64-unknown-freebsd
- x86_64-w64-mingw32
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: "1.9"
- name: Setup BinaryBuilder
env:
BINARYBUILDER_RUNNER: privileged
BINARYBUILDER_AUTOMATIC_APPLE: true
run: |
julia --color=yes -e 'using Pkg; pkg"add BinaryBuilder; build"'
julia --color=yes ./.github/build_tarballs.jl ${{matrix.target}} --verbose
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts
path: products/
- name: Remove logs
run: |
julia --color=yes -e 'rm.(map(f -> joinpath("products/", f), filter(f -> occursin("-logs", f), readdir("products/"))))'
- name: Publish tarball
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: products/*
publish:
name: Cargo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Publish
if: startsWith(github.ref, 'refs/tags/')
uses: actions-rs/cargo@v1
with:
command: publish
args: --no-verify
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
ygg:
name: Yggdrasil
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: "JuliaPackaging/Yggdrasil"
token: ${{ secrets.PAT }}
path: ygg
- uses: actions/checkout@v3
with:
fetch-depth: "0"
path: libcrossterm
- name: Set env
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_ENV"
echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV"
- uses: julia-actions/setup-julia@v1
with:
version: "1.9"
- name: Prepare
run: |
cd libcrossterm
julia .github/update_recipe.jl ../ygg/L/libcrossterm/build_tarballs.jl
- name: Make PR
if: startsWith(github.ref, 'refs/tags/')
id: cpr
uses: peter-evans/create-pull-request@v5
with:
path: ygg
token: ${{ secrets.PAT }}
push-to-fork: kdheepak/Yggdrasil
commit-message: "Bump libcrossterm to ${{ env.TAG_VERSION }}"
title: "[libcrossterm] Bump to ${{ env.TAG_VERSION }}"
branch: libcrossterm/${{ github.ref }}
body: "Automated PR generated for https://github.com/kdheepak/libcrossterm"
- name: Check outputs
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"