Summary: This is really stupid but the download creates a directory with the same name before putting the file in it. I think `v2` no longer does but hey, this is the devil we know. You can look at the actions further down to see that we reference all the other downloads by `filename/filename` as well, so this should do it. Pull Request resolved: https://github.com/facebook/flipper/pull/3366 Test Plan: Another release, I'm afraid. This is a step you cannot dry-run. Reviewed By: cekkaewnumchai, aigoncharov Differential Revision: D33842700 Pulled By: passy fbshipit-source-id: d6f7a4a711ec056ba16f13c72f2c550e9a632ac0
261 lines
7.5 KiB
YAML
261 lines
7.5 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
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/main/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: '14.x'
|
|
- name: Install
|
|
uses: nick-invision/retry@v2.6.0
|
|
with:
|
|
timeout_minutes: 10
|
|
max_attempts: 3
|
|
command: cd ${{env.desktop-directory}} && yarn
|
|
- name: Build
|
|
uses: nick-invision/retry@v2.6.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: '14.x'
|
|
- name: Install
|
|
uses: nick-invision/retry@v2.6.0
|
|
with:
|
|
timeout_minutes: 10
|
|
max_attempts: 3
|
|
command: cd ${{env.desktop-directory}} && yarn
|
|
- name: Build
|
|
uses: nick-invision/retry@v2.6.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: '14.x'
|
|
- name: Install
|
|
uses: nick-invision/retry@v2.6.0
|
|
with:
|
|
timeout_minutes: 10
|
|
max_attempts: 3
|
|
shell: pwsh
|
|
command: cd ${{env.desktop-directory}}; yarn
|
|
- name: Build
|
|
uses: nick-invision/retry@v2.6.0
|
|
with:
|
|
timeout_minutes: 30
|
|
max_attempts: 3
|
|
shell: pwsh
|
|
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'
|
|
|
|
build-flipper-server:
|
|
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: '14.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
|
|
run: cd ${{env.desktop-directory}} && yarn build:flipper-server
|
|
- name: List dist artifacts
|
|
run: ls -l dist/
|
|
- name: Upload flipper-server
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: 'flipper-server.tgz'
|
|
path: 'dist/flipper-server.tgz'
|
|
|
|
publish:
|
|
needs:
|
|
- build-win
|
|
- build-linux
|
|
- build-mac
|
|
- build-flipper-server
|
|
- 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: Download Flipper Server
|
|
if: ${{ needs.release.outputs.tag != '' }}
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: 'flipper-server.tgz'
|
|
path: 'flipper-server.tgz'
|
|
- name: GitHub Upload Release Artifacts
|
|
if: ${{ needs.release.outputs.tag != '' }}
|
|
uses: passy/github-upload-release-artifacts-action@v2.2.2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
created_tag: ${{ needs.release.outputs.tag }}
|
|
args: Flipper-mac.dmg/Flipper-mac.dmg Flipper-linux.zip/Flipper-linux.zip Flipper-win.zip/Flipper-win.zip flipper-server.tgz/flipper-server.tgz
|
|
- name: Set up npm token
|
|
run: echo "//registry.yarnpkg.com/:_authToken=${{ secrets.FLIPPER_NPM_TOKEN }}" >> ~/.npmrc
|
|
- name: Publish flipper-server on NPM
|
|
run: |
|
|
tar zxvf flipper-server.tgz/flipper-server.tgz
|
|
cd package
|
|
yarn publish
|
|
- name: Open issue on failure
|
|
if: failure()
|
|
uses: JasonEtco/create-an-issue@v2.4.0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
REPOSITORY: ${{ github.repository }}
|
|
RUN_ID: ${{ github.run_id }}
|
|
WORKFLOW_NAME: "Publish"
|
|
with:
|
|
filename: .github/action-failure-template.md
|
|
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 }}
|
|
inputs: '{"tag": "${{ needs.release.outputs.tag }}"}'
|