Skip to content

Update dependencies and build node version #8

Update dependencies and build node version

Update dependencies and build node version #8

Workflow file for this run

name: Build and Release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'unbuilt-v*' # Push events to matching unbuilt-v*, i.e. unbuilt-v1.0.0
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Set RELEASE_VERSION environment variable
run: echo "RELEASE_VERSION=${GITHUB_REF:19}" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2
with:
path: main
- name: Checkout release branch
uses: actions/checkout@v2
with:
path: release
ref: release
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 21
- name: NPM Build
run: |
cd ./main
npm ci
npm run build
- name: Copy Module to Release Working Dir
run: |
cp ./main/{README.md,CHANGELOG.md} ./release/
cp -r ./main/farmos_land_drawing_tool/* ./release/
- name: Push Changes to Release Branch and Tag
run: |
cd ./release
git config user.name github-actions
git config user.email [email protected]
git add .
git add -f composer.json
git commit -m "Release ${{ env.RELEASE_VERSION }}"
git tag ${{ env.RELEASE_VERSION }}
git push --atomic origin HEAD:release ${{ env.RELEASE_VERSION }}
- name: Setup SSH Keys and known_hosts for drupal.org
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh/
echo "${{ secrets.DRUPAL_DOT_ORG_SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.DRUPAL_DOT_ORG_SSH_PRIVATE_KEY }}"
- name: Push Changes to Release Branch and Tag on drupal.org Gitlab
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
cd ./release
git config user.name github-actions
git config user.email [email protected]
git remote add drupal-dot-org [email protected]:project/farmos_land_drawing_tool.git
git fetch drupal-dot-org
git push --tags --force drupal-dot-org 'HEAD:refs/heads/release'