yarn 2 #254
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: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- fix/release-workflow | |
concurrency: release | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-22.04 | |
steps: | |
################################################### | |
# | |
# Prepare | |
# | |
################################################### | |
- name: (PREPARE) Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: (PREPARE) Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
fetch-depth: 0 | |
- name: (PREPARE) Setup Apt Packages | |
uses: awalsh128/cache-apt-pkgs-action@v1.3.0 | |
with: | |
packages: graphviz | |
- name: (PREPARE) Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.15.0 | |
cache: yarn | |
- name: (PREPARE) Install Dependencies | |
run: rm -rf node_modules && yarn --immutable | |
- name: (PREPARE) Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
cache: pip | |
- name: (PREPARE) Install xOpera | |
run: pip install pyyaml==5.3.1 opera==0.6.9 | |
################################################### | |
# | |
# Test | |
# | |
################################################### | |
- name: (TEST) Check ESLint | |
run: yarn lint:check | |
- name: (TEST) Check Prettier | |
run: yarn style:check | |
- name: (TEST) Check Dependencies | |
run: yarn dependencies:check | |
- name: (TEST) Check Service Templates | |
run: yarn puccini:check | |
- name: (TEST) Run Tests | |
run: yarn test | |
- name: (TEST) Upload Tests to Codacy | |
uses: codacy/codacy-coverage-reporter-action@v1 | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage/lcov.info | |
################################################### | |
# | |
# Build | |
# | |
################################################### | |
- name: (DOCS) Generate Dependencies Page | |
run: yarn docs:generate:dependencies | |
- name: (BUILD) Build Project | |
run: yarn build | |
- name: (BUILD) Setup Packaging Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.pkg-cache | |
key: pkg | |
- name: (BUILD) Package Binaries | |
run: yarn package | |
- name: (BUILD) Import Signing Key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.VINTNER_RELEASE_PRIVATE_KEY }} | |
- name: (BUILD) Sign Binaries | |
run: | | |
cd dist | |
for BINARY in vintner-alpine-x64 vintner-linux-arm64 vintner-linux-x64 vintner-win-x64.exe | |
do | |
gpg --no-tty --detach-sign -a --local-user vintner-release ${BINARY} | |
done | |
- name: (BUILD) Compress Binaries | |
run: | | |
cd dist | |
for BINARY in vintner-alpine-x64 vintner-linux-arm64 vintner-linux-x64 vintner-win-x64.exe | |
do | |
tar -cJf ${BINARY}.xz ${BINARY} | |
done | |
################################################### | |
# | |
# Release | |
# | |
################################################### | |
- name: (RELEASE) Delete Latest Release | |
run: gh release delete latest --cleanup-tag --yes || true | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: (RELEASE) Delete Latest Tag (Local) | |
run: git tag --delete latest || true | |
- name: (RELEASE) Create Latest Release | |
run: gh release create latest -t "Latest Release" -n "This is the latest release of this project" ./dist/* | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
################################################### | |
# | |
# Docs | |
# | |
################################################### | |
- name: (DOCS) Setup Git | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-"github.com"}" | |
- name: (DOCS) Install Dependencies | |
run: yarn docs:install | |
- name: (DOCS) Build Documentation Commands | |
run: yarn docs:build:commands | |
- name: (DOCS) Generate Interface Page | |
run: yarn docs:generate:interface | |
- name: (DOCS) Generate Variability4TOSCA Conformance Test Pages | |
run: yarn docs:generate:tests:variability | |
- name: (DOCS) Generate Queries4TOSCA Conformance Test Pages | |
run: yarn docs:generate:tests:query | |
- name: (DOCS) Generate TOSCA SofDCar Profile Page | |
run: yarn docs:generate:sofdcar | |
- name: (DOCS) Generate PlantUML of Service Templates | |
run: yarn docs:generate:puml | |
- name: (DOCS) Build and Deploy Docs | |
run: yarn docs:deploy |