Adjusting yaml file and stucts for better naming. Adding to the READM… #9
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: Binary Release | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Single checkout, with submodules | |
- name: Checkout | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Print latest commit | |
run: echo ${{ github.sha }} | |
- name: "Install Zig" | |
run: "sudo snap install zig --classic --beta" | |
# Date for versioning | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Get version date | |
id: version_date | |
run: echo "date=n_$(date +'%y%m%d')" >> $GITHUB_OUTPUT | |
# Linux binary creation | |
- name: Package and create binary for Linux | |
run: | | |
mkdir -p apprunner_linux | |
zig build -p apprunner_linux/ --release=fast -Dtarget=x86_64-linux | |
zip -r apprunner_linux.zip apprunner_linux | |
# MacOS Binary Creation | |
- name: Package and create binary for MacOS | |
run: | | |
mkdir -p apprunner_macos | |
zig build -p apprunner_macos/--release=fast -Dtarget=x86_64-macos | |
zip -r apprunner_macos.zip apprunner_macos | |
# MacOS Binary Creation Apple Silicon | |
- name: Package and create binary for MacOS Apple Silicon | |
run: | | |
mkdir -p apprunner_macos_aarch64 | |
zig build -p apprunner_macos_aarch64/ --release=fast -Dtarget=aarch64-macos | |
zip -r apprunner_macos_aarch64.zip apprunner_macos_aarch64 | |
# Changelog generation | |
- name: Create changelog | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
{ | |
echo 'content<<EOF' | |
python3 .github/workflows/changelog.py | |
echo EOF | |
} >> "$GITHUB_OUTPUT" | |
id: changelog | |
# Release creation | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: binary-tag-${{ steps.date.outputs.date }}-${{ github.sha }} | |
release_name: Binary Release - ${{ steps.date.outputs.date }} | |
body: | | |
**Binary release - ${{ steps.date.outputs.date }}** | |
This build is the latest code changes for apprunner. | |
## Release notes | |
### Revision (${{ steps.version_date.outputs.date }}): | |
${{ steps.changelog.outputs.content }} | |
draft: false | |
prerelease: true | |
# Upload binaries (Linux) | |
- name: Upload Apprunner Binary Linux | |
id: upload-apprunner-binary-linux | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./apprunner_linux.zip | |
asset_name: apprunner${{ steps.version_date.outputs.date }}_binary_linux.zip | |
asset_content_type: application/zip | |
# Upload binaries (MacOS) | |
- name: Upload Apprunner Binary MacOS | |
id: upload-apprunner-binary-mac | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./apprunner_macos.zip | |
asset_name: apprunner${{ steps.version_date.outputs.date }}_binary_macos.zip | |
asset_content_type: application/zip | |
# Upload binaries (MacOS Apple Silicon) | |
- name: Upload Apprunner Binary MacOS | |
id: upload-apprunner-binary-mac-aarch64 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./apprunner_macos_aarch64.zip | |
asset_name: apprunner${{ steps.version_date.outputs.date }}_binary_macos_aarch64.zip | |
asset_content_type: application/zip |