mirror of
https://github.com/zoriya/flood.git
synced 2026-06-07 12:24:50 +00:00
0519a39bd6
Otherwise the earlier builds got overridden.
114 lines
2.7 KiB
YAML
114 lines
2.7 KiB
YAML
name: Publish rolling build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
npm:
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
matrix:
|
|
node: [15]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- run: npm ci --no-optional
|
|
|
|
- name: Tag rolling release
|
|
run: |
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "github-actions[bot]"
|
|
npm version --no-git-tag-version 0.0.0-master.`git rev-parse --short HEAD`
|
|
|
|
- name: Use @${{ github.actor }} scope
|
|
run: |
|
|
jq '.name = "@${{ github.actor }}/flood"' package.json > package.new.json
|
|
mv package.new.json package.json
|
|
|
|
- run: npm publish --access public
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
docker:
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker 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: Publish to Docker Hub
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
push: true
|
|
tags: |
|
|
jesec/flood:master
|
|
|
|
pkg:
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
matrix:
|
|
node: [15]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- run: npm ci --no-optional
|
|
- run: sudo npm install -g pkg
|
|
|
|
- name: Tag rolling release
|
|
run: |
|
|
npm version --no-git-tag-version 0.0.0-master.`git rev-parse --short HEAD`
|
|
|
|
- name: Build executables
|
|
run: |
|
|
npm run build-pkg
|
|
|
|
- name: 'Upload executable: Linux'
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: flood-linux
|
|
path: dist-pkg/flood-linux
|
|
|
|
- name: 'Upload executable: MacOS'
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: flood-macos
|
|
path: dist-pkg/flood-macos
|
|
|
|
- name: 'Upload executable: Windows'
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: flood-win
|
|
path: dist-pkg/flood-win.exe
|