Summary: Depends on https://github.com/facebook/flipper/issues/1914. This sets up the workflows for automatically building, publishing and "closing" the repository on Maven Central, which is a step you usually need to do manually in the web UI. Still need to transfer all the secrets over to this repo for it to work. Pull Request resolved: https://github.com/facebook/flipper/pull/1915 Test Plan: Ran all of this in my this in my fork and released some `0.0.x` versions. - Successful workflow: https://github.com/passy/flipper-1/actions/runs/552170713 - It's actually all on Maven: https://repo.maven.apache.org/maven2/com/facebook/flipper/ Reviewed By: jknoxville Differential Revision: D26367469 Pulled By: passy fbshipit-source-id: d65f64ee8eec1dc71af64b7e0f87473b9c956fec
205 lines
5.7 KiB
YAML
205 lines
5.7 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- 'desktop/package.json'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
tag: ${{ steps.tag-version-commit.outputs.tag }}
|
|
steps:
|
|
- uses: passy/extract-version-commit@v1.0.0
|
|
id: extract-version-commit
|
|
with:
|
|
version_regex: '^Flipper Release: v([0-9]+\.[0-9]+\.[0-9]+)(?:\n|$)'
|
|
- uses: actions/checkout@v2
|
|
if: ${{ steps.extract-version-commit.outputs.commit != ''}}
|
|
with:
|
|
ref: ${{ steps.extract-version-commit.outputs.commit }}
|
|
- name: Tag version commit
|
|
if: ${{ steps.extract-version-commit.outputs.commit != ''}}
|
|
id: tag-version-commit
|
|
uses: passy/tag-version-commit@v1.2.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
ref: ${{ steps.extract-version-commit.outputs.commit }}
|
|
version_tag_prefix: 'v'
|
|
version_assertion_command: 'grep -q "\"version\": \"$version\"" desktop/package.json'
|
|
- name: Create release
|
|
if: ${{ steps.tag-version-commit.outputs.tag != '' }}
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ steps.tag-version-commit.outputs.tag }}
|
|
release_name: ${{ steps.tag-version-commit.outputs.tag }}
|
|
body: |
|
|
See https://github.com/facebook/flipper/blob/master/desktop/static/CHANGELOG.md
|
|
for full notes.
|
|
draft: false
|
|
prerelease: false
|
|
|
|
build-mac:
|
|
needs:
|
|
- release
|
|
runs-on: macos-latest
|
|
env:
|
|
desktop-directory: ./desktop
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ needs.release.outputs.tag }}
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '12.x'
|
|
- name: Install
|
|
uses: nick-invision/retry@v2.0.0
|
|
with:
|
|
timeout_minutes: 10
|
|
max_attempts: 3
|
|
command: cd ${{env.desktop-directory}} && yarn
|
|
- name: Build
|
|
uses: nick-invision/retry@v2.0.0
|
|
with:
|
|
timeout_minutes: 30
|
|
max_attempts: 3
|
|
command: cd ${{env.desktop-directory}} && yarn build --mac --mac-dmg
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: 'Flipper-mac.dmg'
|
|
path: 'dist/Flipper-mac.dmg'
|
|
|
|
build-linux:
|
|
needs:
|
|
- release
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
desktop-directory: ./desktop
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ needs.release.outputs.tag }}
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '12.x'
|
|
- name: Install
|
|
uses: nick-invision/retry@v2.0.0
|
|
with:
|
|
timeout_minutes: 10
|
|
max_attempts: 3
|
|
command: cd ${{env.desktop-directory}} && yarn
|
|
- name: Build
|
|
uses: nick-invision/retry@v2.0.0
|
|
with:
|
|
timeout_minutes: 30
|
|
max_attempts: 3
|
|
command: cd ${{env.desktop-directory}} && yarn build --linux
|
|
- name: Upload Linux
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: 'Flipper-linux.zip'
|
|
path: 'dist/Flipper-linux.zip'
|
|
|
|
build-win:
|
|
needs:
|
|
- release
|
|
runs-on: windows-latest
|
|
env:
|
|
desktop-directory: ./desktop
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ needs.release.outputs.tag }}
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '12.x'
|
|
- name: Install
|
|
uses: nick-invision/retry@v2.0.0
|
|
with:
|
|
timeout_minutes: 10
|
|
max_attempts: 3
|
|
command: cd ${{env.desktop-directory}} && yarn
|
|
- name: Build
|
|
uses: nick-invision/retry@v2.0.0
|
|
with:
|
|
timeout_minutes: 30
|
|
max_attempts: 3
|
|
command: cd ${{env.desktop-directory}} && yarn build --win
|
|
- name: Upload Windows
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: 'Flipper-win.zip'
|
|
path: 'dist/Flipper-win.zip'
|
|
|
|
publish:
|
|
needs:
|
|
- build-win
|
|
- build-linux
|
|
- build-mac
|
|
- release
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Download Mac
|
|
if: ${{ needs.release.outputs.tag != '' }}
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: 'Flipper-mac.dmg'
|
|
path: 'Flipper-mac.dmg'
|
|
- name: Download Linux
|
|
if: ${{ needs.release.outputs.tag != '' }}
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: 'Flipper-linux.zip'
|
|
path: 'Flipper-linux.zip'
|
|
- name: Download Windows
|
|
if: ${{ needs.release.outputs.tag != '' }}
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: 'Flipper-win.zip'
|
|
path: 'Flipper-win.zip'
|
|
- name: GitHub Upload Release Artifacts
|
|
if: ${{ needs.release.outputs.tag != '' }}
|
|
uses: passy/github-upload-release-artifacts-action@v2.1.1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
created_tag: ${{ needs.release.outputs.tag }}
|
|
args: Flipper-mac.dmg Flipper-linux.zip Flipper-win.zip
|
|
|
|
dispatch:
|
|
needs:
|
|
- release
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Publish Workflow Dispatch
|
|
if: ${{ needs.release.outputs.tag != '' }}
|
|
uses: benc-uk/workflow-dispatch@v1.1
|
|
with:
|
|
workflow: Publish Pods
|
|
token: ${{ secrets.PERSONAL_TOKEN }}
|
|
ref: ${{ needs.release.outputs.tag }}
|
|
- name: Publish NPM
|
|
if: ${{ needs.release.outputs.tag != '' }}
|
|
uses: benc-uk/workflow-dispatch@v1.1
|
|
with:
|
|
workflow: Publish NPM
|
|
token: ${{ secrets.PERSONAL_TOKEN }}
|
|
ref: ${{ needs.release.outputs.tag }}
|
|
- name: Publish Android
|
|
if: ${{ needs.release.outputs.tag != '' }}
|
|
uses: benc-uk/workflow-dispatch@v1.1
|
|
with:
|
|
workflow: Publish Android
|
|
token: ${{ secrets.PERSONAL_TOKEN }}
|
|
ref: ${{ needs.release.outputs.tag }}
|