Use macos-latest-xlarge as runner arch #34
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
# .github/workflows/release.yml | |
name: Release | |
on: | |
push: | |
branches: [main] | |
permissions: | |
contents: write | |
jobs: | |
build-release: | |
name: Build artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Set up QEMU for ARM64 | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64 | |
- name: Build package in ARM64 container | |
uses: docker://batonogov/pyinstaller-linux:latest | |
with: | |
args: | | |
bash -c " | |
apt-get update && apt-get install -y zip && \ | |
pip install -r /workspace/requirements.txt && \ | |
pyinstaller --onefile /workspace/src/app.py && \ | |
mkdir -p /workspace/.artie && \ | |
cp -r /workspace/dist/app /workspace/assets /workspace/config.json /workspace/.artie && \ | |
cd /workspace && \ | |
zip -r Artie.zip .artie ./Artie\ Scraper.sh | |
" | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
- name: Get HEAD commit hash | |
id: get_commit | |
run: echo "::set-output name=commit_hash::$(git rev-parse HEAD)" | |
- name: Upload Artie.zip | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Artie | |
path: Artie.zip | |
- name: Generate release tag | |
id: tag | |
run: | | |
echo "::set-output name=release_tag::Artie_$(date +"%Y.%m.%d_%H-%M")" | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: Artie.zip | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
release_name: Release ${{ steps.get_commit.outputs.commit_hash }} |