Skip to content

Commit

Permalink
Further refinements to the release workflow (#42)
Browse files Browse the repository at this point in the history
* Sync main->dev (#39)

* v0.1.0 (#37)

* Remove external deps (Curl) and refactor release process (#35)

* fix: remove curl and get pcre to work as natural dependency

* feat: readme updates, mappings test script

* feat: reusable github workflow revision

* fix: license includes BSD/PCRE, fix tests

* fix: don't rely on windows compress-archive

* fix: refactor release workflow, bump timeout to 10 mins

* fix: add input for pr-release workflow

* fix: refactor workflows to use nested with format

* feat: CLI tests

* chore: remove unneeded cli test comments

* docs: update docquery->filing urls, and secondary -> converted paper

* fix: trailing cli filing id bug

* fix a few oversights with v8.4 mappings (#31)

Co-authored-by: Dylan Freedman <freedmand@gmail.com>

* Fix custom write function segfault (#32)

* DENG-116 Change buffer size

* Revert "DENG-116 Change buffer size"

This reverts commit 0ae41c3.

* Use a POINTER(c_char) instead of a c_char_p for CUSTOM_WRITE contents

* Add a smoke test for filing 1606847

Co-authored-by: crystaljg <70042918+crystaljg@users.noreply.github.com>
Co-authored-by: Crystal Gong <cgong@actbluetech.com>

* fix: release to latest tag, bump to 0.1.0 (#36)

Co-authored-by: Chris Zubak-Skees <chriszs@gmail.com>
Co-authored-by: Evan Sonderegger <evan@rpy.xyz>
Co-authored-by: james-clemer-actblue <69259105+james-clemer-actblue@users.noreply.github.com>
Co-authored-by: crystaljg <70042918+crystaljg@users.noreply.github.com>
Co-authored-by: Crystal Gong <cgong@actbluetech.com>

* fix: main release workflow bug

* feat: 0.1.1

* feat: use ref name to get current tag

* feat: version 0.1.3

Co-authored-by: Chris Zubak-Skees <chriszs@gmail.com>
Co-authored-by: Evan Sonderegger <evan@rpy.xyz>
Co-authored-by: james-clemer-actblue <69259105+james-clemer-actblue@users.noreply.github.com>
Co-authored-by: crystaljg <70042918+crystaljg@users.noreply.github.com>
Co-authored-by: Crystal Gong <cgong@actbluetech.com>

* fix: upload artifacts in release process (#40)

* fix: upload artifacts in release process

* fix: erroneous steps

* fix: run wheels on all platforms

* fix: add inputs prefix to if conditionals in actions

* feat: bump version to 0.1.4

* feat: GH actions matrix

* fix: add exe ext to actions map

* feat: remove apt-get update

* fix: give windows the .exe extension, not linux

* feat: matrix for wheels as well

* test: speed up test workflow

* feat: split test workflow into two parallel tracks

test c and test python

* fix: missing actions checkout step added

* feat: remove non-wheel artifacts for PyPI publish (#41)

* test: use uppercase secrets

* feat: refactor pypiToken as reusable workflow input

* fix: pass secrets properly

* fix: pass secrets properly

* test: pass secrets appropriately

* test: inherit secrets

* test: remove type from secrets

* test: remove secrets section

Co-authored-by: Chris Zubak-Skees <chriszs@gmail.com>
Co-authored-by: Evan Sonderegger <evan@rpy.xyz>
Co-authored-by: james-clemer-actblue <69259105+james-clemer-actblue@users.noreply.github.com>
Co-authored-by: crystaljg <70042918+crystaljg@users.noreply.github.com>
Co-authored-by: Crystal Gong <cgong@actbluetech.com>
  • Loading branch information
6 people committed Aug 4, 2022
1 parent 4b3b426 commit 01b4473
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 152 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/_python-wheels.yml
@@ -1,11 +1,25 @@
# A reusable workflow for building cross-platform Python wheels

on: workflow_call
on:
workflow_call:
inputs:
publishToPyPI:
required: false
default: false
type: boolean
publishToTestPyPI:
required: false
default: false
type: boolean

jobs:
build-wheels:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
os: [linux, macos, windows]
architecture: [x86_64, aarch64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -16,8 +30,35 @@ jobs:
run: python -m pip install ziglang==0.9.1 wheel==0.37.1

- name: Build wheels
run: python python/make_wheels.py
run: python python/make_wheels.py ${{ matrix.architecture }}-${{ matrix.os }}

- uses: actions/upload-artifact@v2
with:
name: wheels
path: ./wheelhouse/*.whl

upload-wheels-to-pypi:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build-wheels]
if: inputs.publishToPyPI || inputs.publishToTestPyPI
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
path: dist

- name: Publish package to PyPI
if: inputs.publishToPyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Publish package to Test PyPI
if: inputs.publishToTestPyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
108 changes: 82 additions & 26 deletions .github/workflows/_release.yml
Expand Up @@ -6,39 +6,95 @@ on:
version:
required: true
type: string
uploadRelease:
required: false
default: false
type: boolean

jobs:
build-for-release:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
os: [linux, macos, windows]
architecture: [x86_64, aarch64]
include:
- os: wasm
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.9.1
- run: |
sudo apt-get update
sudo apt install -y libcurl4-openssl-dev
# Linux/Wasm
- run: zig build
- run: zip -j fastfec-linux-x86_64-${{ inputs.version }}.zip zig-out/bin/fastfec
- run: mv zig-out/lib/libfastfec.so libfastfec-linux-x86_64-${{ inputs.version }}.so
- run: zig build -Dtarget=aarch64-linux
- run: zip -j fastfec-linux-aarch64-${{ inputs.version }}.zip zig-out/bin/fastfec
- run: mv zig-out/lib/libfastfec.so libfastfec-linux-aarch64-${{ inputs.version }}.so
- run: zig build -Dwasm
- run: mv zig-out/lib/fastfec.wasm libfastfec-${{ inputs.version }}.wasm
# Mac
- run: zig build -Dtarget=x86_64-macos
- run: zip -j fastfec-macos-x86_64-${{ inputs.version }}.zip zig-out/bin/fastfec
- run: mv zig-out/lib/libfastfec.dylib libfastfec-macos-x86_64-${{ inputs.version }}.dylib
- run: zig build -Dtarget=aarch64-macos
- run: zip -j fastfec-macos-aarch64-${{ inputs.version }}.zip zig-out/bin/fastfec
- run: mv zig-out/lib/libfastfec.dylib libfastfec-macos-aarch64-${{ inputs.version }}.dylib
# Windows
- run: zig build -Dtarget=x86_64-windows
- run: zip -j fastfec-windows-x86_64-${{ inputs.version }}.zip zig-out/bin/fastfec.exe
- run: mv zig-out/lib/fastfec.dll libfastfec-windows-x86_64-${{ inputs.version }}.dll
- run: zig build -Dtarget=aarch64-windows
- run: zip -j fastfec-windows-aarch64-${{ inputs.version }}.zip zig-out/bin/fastfec.exe
- run: mv zig-out/lib/fastfec.dll libfastfec-windows-aarch64-${{ inputs.version }}.dll
- name: Get output paths
uses: kanga333/variable-mapper@master
id: map
with:
key: "${{ matrix.os }}"
map: |
{
"linux": {
"libExt": "so",
"libName": "libfastfec",
"exeExt": ""
},
"mac": {
"libExt": "dylib",
"libName": "libfastfec",
"exeExt": ""
},
"windows": {
"libExt": "dll",
"libName": "fastfec",
"exeExt": ".exe"
},
"wasm": {
"libExt": "wasm",
"libName": "fastfec",
"exeExt": ""
}
}
export_to: output
- name: Build target
if: matrix.os != 'wasm'
run: zig build -Dtarget=${{ matrix.architecture }}-${{ matrix.os }}
- name: Build target (wasm)
if: matrix.os == 'wasm'
run: zig build -Dwasm
- name: Zip output executable
if: matrix.os != 'wasm'
run: zip -j fastfec-${{ matrix.os }}-${{ matrix.architecture }}-${{ inputs.version }}.zip zig-out/bin/fastfec${{ steps.map.outputs.exeExt }}
- name: Move output library
if: matrix.os != 'wasm'
run: mv zig-out/lib/${{ steps.map.outputs.libName }}.${{ steps.map.outputs.libExt }} libfastfec-${{ matrix.os }}-${{ matrix.architecture }}-${{ inputs.version }}.${{ steps.map.outputs.libExt }}
- name: Move output library (wasm)
if: matrix.os == 'wasm'
run: mv zig-out/lib/${{ steps.map.outputs.libName }}.${{ steps.map.outputs.libExt }} libfastfec-${{ inputs.version }}.${{ steps.map.outputs.libExt }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
if: matrix.os != 'wasm'
with:
path: |
fastfec-${{ matrix.os }}-${{ matrix.architecture }}-${{ inputs.version }}.zip
libfastfec-${{ matrix.os }}-${{ matrix.architecture }}-${{ inputs.version }}.${{ steps.map.outputs.libExt }}
- name: Upload artifacts (wasm)
uses: actions/upload-artifact@v2
if: matrix.os == 'wasm'
with:
path: |
libfastfec-${{ inputs.version }}.${{ steps.map.outputs.libExt }}
- name: GitHub release
uses: softprops/action-gh-release@v1
if: inputs.uploadRelease && matrix.os != 'wasm'
with:
tag_name: ${{ inputs.version }}
files: |
fastfec-${{ matrix.os }}-${{ matrix.architecture }}-${{ inputs.version }}.zip
libfastfec-${{ matrix.os }}-${{ matrix.architecture }}-${{ inputs.version }}.${{ steps.map.outputs.libExt }}
- name: GitHub release (wasm)
uses: softprops/action-gh-release@v1
if: inputs.uploadRelease && matrix.os == 'wasm'
with:
tag_name: ${{ inputs.version }}
files: |
libfastfec-${{ inputs.version }}.${{ steps.map.outputs.libExt }}
46 changes: 6 additions & 40 deletions .github/workflows/beta-release.yml
Expand Up @@ -8,48 +8,14 @@ on:
- develop

jobs:
build-for-beta-release:
build-and-upload-beta-release:
uses: ./.github/workflows/_release.yml
with:
version: latest
uploadRelease: true

upload-beta-release:
needs: [build-for-beta-release]
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v1
with:
tag_name: latest
files: |
fastfec-linux-x86_64-latest.zip
libfastfec-linux-x86_64-latest.so
fastfec-linux-aarch64-latest.zip
libfastfec-linux-aarch64-latest.so
fastfec-macos-x86_64-latest.zip
libfastfec-macos-x86_64-latest.dylib
fastfec-macos-aarch64-latest.zip
libfastfec-macos-aarch64-latest.dylib
fastfec-windows-x86_64-latest.zip
libfastfec-windows-x86_64-latest.dll
fastfec-windows-aarch64-latest.zip
libfastfec-windows-aarch64-latest.dll
libfastfec-latest.wasm
build-wheels-for-beta-release:
build-and-upload-beta-wheels:
uses: ./.github/workflows/_python-wheels.yml

upload-wheels-for-beta-release:
needs: [build-wheels-for-beta-release]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.test_pypi_token }}
repository_url: https://test.pypi.org/legacy/
with:
publishToTestPyPI: true
secrets: inherit
25 changes: 2 additions & 23 deletions .github/workflows/pr-release.yml
Expand Up @@ -8,31 +8,10 @@ on:
- develop

jobs:
build-for-pr-release:
build-pr-release:
uses: ./.github/workflows/_release.yml
with:
version: latest

upload-pr-release:
needs: [build-for-pr-release]
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact@v2
with:
path: |
fastfec-linux-x86_64-latest.zip
libfastfec-linux-x86_64-latest.so
fastfec-linux-aarch64-latest.zip
libfastfec-linux-aarch64-latest.so
fastfec-macos-x86_64-latest.zip
libfastfec-macos-x86_64-latest.dylib
fastfec-macos-aarch64-latest.zip
libfastfec-macos-aarch64-latest.dylib
fastfec-windows-x86_64-latest.zip
libfastfec-windows-x86_64-latest.dll
fastfec-windows-aarch64-latest.zip
libfastfec-windows-aarch64-latest.dll
libfastfec-latest.wasm
build-wheels-for-pr-release:
build-pr-wheels:
uses: ./.github/workflows/_python-wheels.yml
45 changes: 6 additions & 39 deletions .github/workflows/stable-release.yml
Expand Up @@ -8,49 +8,16 @@ on:
- "*.*.*"

jobs:
build-for-stable-release:
build-and-upload-stable-release:
if: github.event.base_ref == 'refs/heads/main'
uses: ./.github/workflows/_release.yml
with:
version: ${{ github.ref_name }}
uploadRelease: true

upload-stable-release:
needs: [build-for-stable-release]
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v1
with:
files: |
fastfec-linux-x86_64-${{ github.ref_name }}.zip
libfastfec-linux-x86_64-${{ github.ref_name }}.so
fastfec-linux-aarch64-${{ github.ref_name }}.zip
libfastfec-linux-aarch64-${{ github.ref_name }}.so
fastfec-macos-x86_64-${{ github.ref_name }}.zip
libfastfec-macos-x86_64-${{ github.ref_name }}.dylib
fastfec-macos-aarch64-${{ github.ref_name }}.zip
libfastfec-macos-aarch64-${{ github.ref_name }}.dylib
fastfec-windows-x86_64-${{ github.ref_name }}.zip
libfastfec-windows-x86_64-${{ github.ref_name }}.dll
fastfec-windows-aarch64-${{ github.ref_name }}.zip
libfastfec-windows-aarch64-${{ github.ref_name }}.dll
libfastfec-${{ github.ref_name }}.wasm
build-wheels-for-stable-release:
build-and-upload-stable-wheels:
if: github.event.base_ref == 'refs/heads/main'
uses: ./.github/workflows/_python-wheels.yml

upload-wheels-for-stable-release:
if: github.event.base_ref == 'refs/heads/main'
needs: [build-wheels-for-stable-release]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.pypi_token }}
with:
publishToPyPI: true
secrets: inherit
30 changes: 14 additions & 16 deletions .github/workflows/test.yml
@@ -1,36 +1,34 @@
name: Test
on: [push]
jobs:
test:
test-c:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: [3.8]
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.9.1
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt install -y libcurl4-openssl-dev
- name: Run zig test
run: zig build test

test-python:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run zig build
run: zig build
- name: Run zig test
run: zig build test
- name: Ensure mappings are up-to-date
run: python scripts/generate_mappings.py test
- name: Install Python dependencies
working-directory: python
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
run: pip install -r requirements-dev.txt
- name: Run Python Tests
working-directory: python
run: tox -e py
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.1.3
0.1.6

0 comments on commit 01b4473

Please sign in to comment.