Skip to content

Commit

Permalink
Add a manual GH action to build artifacts.
Browse files Browse the repository at this point in the history
  • Loading branch information
hq6 committed Apr 7, 2024
1 parent 74c41d0 commit c8153de
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build Artifacts

on:
workflow_dispatch:
# This input is needed in order to build commits that existed before this
# workflow was added.
inputs:
target_commit:
description: 'The commit to build.'
required: true
type: string

jobs:
build-linux-artifact:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.target_commit }}
- name: make
run: make
# This step does a stupid double-wrapping but is necessary because
# upload-artifact uses a zip command (which cannot be disabled) that
# removes executable bits.
- name: package
run: tar cvfz protobufjson-linux.tar.gz JsonToProto ProtoToJson
- uses: actions/upload-artifact@v4
with:
name: protobufjson-linux-${{ inputs.target_commit }}.tar.gz
path: protobufjson-linux.tar.gz
if-no-files-found: error
compression-level: 0

build-osx-intel-artifact:
runs-on: macos-13

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.target_commit }}
- name: make
run: make
# This step does a stupid double-wrapping but is necessary because
# upload-artifact uses a zip command (which cannot be disabled) that
# removes executable bits.
- name: package
run: tar cvfz protobufjson-macos-intel.tar.gz JsonToProto ProtoToJson
- uses: actions/upload-artifact@v4
with:
name: protobufjson-macos-intel-${{ inputs.target_commit }}.tar.gz
path: protobufjson-macos-intel.tar.gz
if-no-files-found: error
compression-level: 0

build-osx-arm-artifact:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.target_commit }}
- name: make
run: make
# This step does a stupid double-wrapping but is necessary because
# upload-artifact uses a zip command (which cannot be disabled) that
# removes executable bits.
- name: package
run: tar cvfz protobufjson-macos-arm.tar.gz JsonToProto ProtoToJson
- uses: actions/upload-artifact@v4
with:
name: protobufjson-macos-arm-${{ inputs.target_commit }}.tar.gz
path: protobufjson-macos-arm.tar.gz
if-no-files-found: error
compression-level: 0

0 comments on commit c8153de

Please sign in to comment.