Should now be more modular, at the cost of human-readable names. It can now be used to build android versions, alpine versions, as well as arm for each supported platform
66 lines
2.2 KiB
YAML
66 lines
2.2 KiB
YAML
name: Release Builds
|
|
|
|
on:
|
|
release:
|
|
types: [ created ]
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
build_type: [ linux, macos, windows ]
|
|
build_arch: [ x64 ]
|
|
gui: [ gui, cli ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 8.6.6
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
check-latest: true
|
|
- name: Install Node modules
|
|
run: |
|
|
pnpm install
|
|
- name: Get name and version from package.json
|
|
run: |
|
|
test -n $(node -p -e "require('./package.json').name") &&
|
|
test -n $(node -p -e "require('./package.json').version") &&
|
|
echo PACKAGE_NAME=$(node -p -e "require('./package.json').name") >> $GITHUB_ENV &&
|
|
echo PACKAGE_VERSION=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV || exit 1
|
|
- name: Make build
|
|
run: pnpm run build-${{ matrix.build_type }}-${{ matrix.gui }}
|
|
- name: Upload release
|
|
uses: actions/upload-release-asset@v1
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_name: multi-downloader-nx-${{ matrix.build_type }}-${{ matrix.gui }}.7z
|
|
asset_path: ./lib/_builds/multi-downloader-nx-${{ matrix.build_type }}-${{ matrix.build_arch }}-${{ matrix.gui }}.7z
|
|
asset_content_type: application/x-7z-compressed
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
build-docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Build and push Docker images
|
|
uses: docker/build-push-action@v2.9.0
|
|
with:
|
|
github-token: ${{ github.token }}
|
|
push: true
|
|
tags: |
|
|
"izuco/multi-downloader-nx:${{ github.event.release.tag_name }}"
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|