Release #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
name: Build binary | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
name: ${{ github.event.repository.name }}-${{ github.ref_name }}-ubuntu-amd64.tar.gz | |
- os: macos-12 | |
name: ${{ github.event.repository.name }}-${{ github.ref_name }}-macos-amd64.tar.gz | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Release build os - ${{ matrix.os }} | |
run: | | |
chmod +x ci/release-build.sh | |
./ci/release-build.sh install ${{ matrix.os }} ${{ env.BUILD_TYPE }} | |
- name: Calculate checksum and rename binary | |
run: | | |
chmod +x ci/release-build.sh | |
./ci/release-build.sh checksum ${{ github.event.repository.name }} ${{ matrix.name }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.name }} | |
path: build/${{ matrix.name }} | |
- name: Upload checksum of artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.name }}.sha256sum | |
path: build/${{ matrix.name }}.sha256sum | |
centos: | |
runs-on: ubuntu-latest | |
container: | |
image: cheniujh/pika-centos7-ci:v5 | |
env: | |
name: ${{ github.event.repository.name }}-${{ github.ref_name }}-centos-amd64.tar.gz | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
with: | |
fetch-depth: 0 | |
- name: Install Python 3 | |
run: | | |
yum install -y python3 | |
# - name: Release build os - centos | |
# run: | | |
# chmod +x ci/release-build.sh | |
# ./ci/release-build.sh install centos ${{ env.BUILD_TYPE }} -xe | |
- name: Mock Release build os - centos | |
run: | | |
mkdir -p build | |
# 生成一个100MB的文件,代替实际编译 | |
dd if=/dev/zero of=build/${{ env.name }} bs=1M count=100 | |
# - name: Calculate checksum and rename binary | |
# shell: bash | |
# run: ./ci/release-build.sh checksum ${{ github.event.repository.name }} ${{ env.name }} | |
- name: Install Python dependencies for uploading artifacts | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install requests | |
- name: Upload artifacts using Python script | |
run: | | |
python3 ci/upload_artifact.py build/${{ env.name }} "${{ env.name }}" | |
python3 ci/upload_artifact.py build/${{ env.name }}.sha256sum "${{ env.name }}.sha256sum" | |
release: | |
name: Release artifacts | |
needs: [ build, centos ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
- name: Publish release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: "Release ${{ github.ref_name }}" | |
generate_release_notes: true | |
files: | | |
**/${{ github.event.repository.name }}-* |