ci: workaround for downloading artifacts in CentOS 7 #411
Workflow file for this run
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
name: Automated deploy | |
on: | |
pull_request: | |
branches: | |
- '**' | |
env: | |
VERSION: 'v13.0.0-next.1' | |
TARGET_REF: 'next' | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
jobs: | |
install-deps: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.TARGET_REF }} | |
token: ${{ secrets.GPR_TOKEN }} | |
- name: Install deps | |
uses: ./.github/workflows/composite/npm | |
build: | |
runs-on: ubuntu-latest | |
needs: install-deps | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.TARGET_REF }} | |
token: ${{ secrets.GPR_TOKEN }} | |
- name: Install deps | |
uses: ./.github/workflows/composite/npm | |
- name: Set default distribution | |
run: npm pkg set brightCli.distribution=package | |
- name: Build package | |
run: npm run build | |
env: | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
- name: Pack artifacts | |
run: npm pack | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: | | |
dist | |
Dockerfile | |
package.json | |
package-lock.json | |
README.md | |
LICENSE | |
tools | |
generate-binary: | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Using the `centos7-devtoolset7` runner instead of latest (i.e. `ubuntu-20.04`) | |
# with gcc 7 but glibc 2.17, so binaries are compatible for Ubuntu 14.04 and Debian 8. | |
- os: ubuntu-20.04 | |
target: linux | |
node: 16 | |
container: | |
image: centos/devtoolset-7-toolchain-centos7:7 | |
options: "--user root" | |
volumes: | |
- /node20glib217:/node20glib217:rw,rshared | |
- /node20glib217:/__e/node20:ro,rshared | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.container }} | |
steps: | |
- name: Install dev-deps | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \ | |
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ | |
&& yum install build-essential python3 -y \ | |
&& yum clean all -y \ | |
&& rm -rf /var/cache/yum | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.TARGET_REF }} | |
token: ${{ secrets.GPR_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build | |
- name: Install deps | |
uses: ./.github/workflows/composite/npm | |
with: | |
version: ${{ matrix.node }} | |
- name: Set distribution | |
run: npx json -I -f package.json -e "this.brightCli.distribution='${{ matrix.target }}-executable'" | |
- name: Build executable file | |
run: npm run build:pkg -- -t node${{ matrix.node }}-${{ matrix.target }}-x64 | |
- name: Build MSI | |
if: startsWith(matrix.os, 'win') | |
run: .\tools\scripts\build-msi.ps1 | |
shell: pwsh | |
- uses: svenstaro/upload-release-action@2.7.0 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ startsWith(matrix.os, 'win') && '.\bin\cli.exe' || './bin/cli' }} | |
asset_name: ${{ format('bright-cli-{0}-x64{1}', matrix.target, startsWith(matrix.os, 'win') && '.exe' || '') }} | |
tag: 'refs/tags/${{ env.VERSION }}' | |
- uses: svenstaro/upload-release-action@2.7.0 | |
if: startsWith(matrix.os, 'win') | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: .\bin\bright-cli.msi | |
asset_name: bright-cli.msi | |
tag: 'refs/tags/${{ env.VERSION }}' |