Skip to content

Update CD.yml

Update CD.yml #66

Workflow file for this run

name: CD
on:
push:
tags: 'v*'
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Cache node modules
uses: actions/[email protected]
with:
path: node_modules
key: node-${{ hashFiles('package-lock.json') }}
- name: Generate package
id: package
run: |
version="${GITHUB_REF##*/*/v}"
echo ::set-output name=version::$version
npm install
npm run build -- $version python${{ matrix.python }}-linux
env:
TOKEN: ${{ secrets.TOKEN }}
- name: Upload
uses: softprops/action-gh-release@v1
with:
files: "GeodePackage-${{ steps.package.outputs.version }}-python${{ matrix.python }}-linux.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify slack
if: failure() && github.ref == 'refs/heads/master'
uses: 8398a7/action-slack@v2
with:
status: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
build-windows:
runs-on: windows-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Cache node modules
uses: actions/[email protected]
with:
path: node_modules
key: node-${{ hashFiles('package-lock.json') }}
- name: Generate package
id: package
run: |
$version = ${env:GITHUB_REF} -replace 'refs\/tags\/v', ''
echo "::set-output name=version::$version"
npm install
npm run build -- $version python${{ matrix.python }}-win64
env:
TOKEN: ${{ secrets.TOKEN }}
- name: Upload
uses: softprops/action-gh-release@v1
with:
files: "GeodePackage-${{ steps.package.outputs.version }}-python${{ matrix.python }}-win64.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify slack
if: failure() && github.ref == 'refs/heads/master'
uses: 8398a7/action-slack@v2
with:
status: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}