Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
flatsiedatsie authored Dec 18, 2023
1 parent b6f188e commit 519e309
Showing 1 changed file with 75 additions and 28 deletions.
103 changes: 75 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,86 @@ on:
types: [created]

jobs:
build:
get-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Package project
run: |
./package.sh
- name: Get Release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Dump upload url to file
run: echo '${{ steps.get_release.outputs.upload_url }}' > upload_url
- name: Upload upload_url
uses: actions/upload-artifact@v3
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: network-presence-detection-adapter-${{ steps.get_release.outputs.tag_name }}.tgz
asset_name: network-presence-detection-adapter-${{ steps.get_release.outputs.tag_name }}.tgz
asset_content_type: application/gnutar
- name: Upload Release Asset Checksum
id: upload-release-asset-checksum
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: upload_url
path: upload_url

build:
needs: get-release
strategy:
matrix:
platform: [
'linux-arm',
'linux-arm64',
# 'linux-x64',
]
pair: [
# 'python:3.7',
'python:3.9',
]
include:
- platform: 'linux-arm'
host-os: 'ubuntu-latest'
- platform: 'linux-arm64'
host-os: 'ubuntu-latest'
# - platform: 'linux-x64'
# host-os: 'ubuntu-latest'
# - pair: 'python:3.7'
# language: 'python'
# version: '3.7'
- pair: 'python:3.9'
language: 'python'
version: '3.9'

runs-on: ${{ matrix.host-os }}

steps:
- name: Download upload_url
uses: actions/download-artifact@v3
with:
name: upload_url
path: upload_url
- name: Set upload_url
run: echo "UPLOAD_URL=$(cat upload_url/upload_url)" >> $GITHUB_ENV
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Use Python ${{ matrix.version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
- name: Make build script executable
run: chmod +x ./build.sh
- name: Make packaging script executable
run: chmod +x ./package.sh
- name: Build adapter
run: |
./build.sh "${{ matrix.platform }}" "${{ matrix.language }}" "${{ matrix.version }}"
shell: bash

- name: Upload Release Asset tgz
uses: shogo82148/actions-upload-release-asset@v1
with:
#upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ env.UPLOAD_URL }}
asset_path: network-presence-detection-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz

- name: Upload Release Asset shasum
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: network-presence-detection-adapter-${{ steps.get_release.outputs.tag_name }}.tgz.sha256sum
asset_name: network-presence-detection-adapter-${{ steps.get_release.outputs.tag_name }}.tgz.sha256sum
asset_content_type: text/plain
#upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ env.UPLOAD_URL }}
asset_path: network-presence-detection-adapter-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz.sha256sum

0 comments on commit 519e309

Please sign in to comment.