mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
08b93b386d
See https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
48 lines
1.8 KiB
YAML
48 lines
1.8 KiB
YAML
name: Create 2.x release
|
|
on:
|
|
push:
|
|
tags:
|
|
- '2.*'
|
|
|
|
jobs:
|
|
build:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@master
|
|
- name: Set FARMOS_VERSION environment variable
|
|
run: echo "FARMOS_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
|
|
# This builds the Docker image using the specified FARMOS_VERSION,
|
|
# but notably it does NOT override the default PROJECT_VERSION, so the
|
|
# farmOS Composer project 2.x branch is always used.
|
|
- name: Build farmOS 2.x Docker image
|
|
run: docker build --build-arg FARMOS_REPO=https://github.com/${GITHUB_REPOSITORY} --build-arg FARMOS_VERSION=${FARMOS_VERSION} -t farmos/farmos:2.x docker
|
|
- name: Run farmOS Docker container
|
|
run: >-
|
|
docker run --rm -v /tmp/farmOS:/opt/drupal farmos/farmos:2.x sed -i "s|version: 2.x|version: ${FARMOS_VERSION}|g" /opt/drupal/web/profiles/farm/farm.info.yml
|
|
- name: Create artifact
|
|
run: cd /tmp && tar -czf farmOS-${FARMOS_VERSION}.tar.gz farmOS
|
|
- name: Create GitHub release
|
|
id: create_release
|
|
uses: actions/create-release@latest
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: ${{ github.ref }}
|
|
body: |
|
|
...
|
|
draft: true
|
|
prerelease: false
|
|
- name: Upload release asset
|
|
id: upload-release-asset
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: /tmp/farmOS-${{ env.FARMOS_VERSION }}.tar.gz
|
|
asset_name: farmOS-${{ env.FARMOS_VERSION }}.tar.gz
|
|
asset_content_type: application/gzip
|