Skip to content

update script

update script #16

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI/CD
# Controls when the workflow will run
on:
pull_request:
branches:
- main
push:
tags:
- "v*"
workflow_dispatch:
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellinclude
run: sudo cp src/* /usr/bin
- name: Test shellinclude from cmd
run: echo "Build a test for shellinclude!!!"
- name: Test shellinclude from script
run: echo "Build another test for shellinclude!!!"
build:
runs-on: ubuntu-latest
needs: unit-tests
steps:
- uses: actions/checkout@v4
- name: Create a debian package
run: |
cd infra/build
./debianize.sh
- name: Install debian package
run: cd infra/build; PACKAGE=$(ls *.deb); sudo dpkg -i ./$PACKAGE
- name: Test shellinclude from cmd
run: echo "[TODO] Build a debian package for shellinclude"
- name: Test shellinclude from script
run: echo "[TODO] Build a debian package for shellinclude"
- name: Test documentation installation
run: ./infra/scripts/doc_install_check.sh
delivery:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Create a debian package
run: |
cd infra/build
./debianize.sh
mkdir debian; mv *.deb debian; mv debian /tmp
- name: Upload changelog artifact
uses: actions/upload-artifact@v4
with:
name: shellinclude_debian
path: /tmp/debian
retention-days: 0
deploy:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
needs: delivery
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Check version
run: ./infra/scripts/version_check.sh
- name: Create a debian package
run: |
cd infra/build
./debianize.sh
zip --junk-paths debian.zip *.deb; mv debian.zip /tmp
- name: Build Release notes
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
RELEASE_NAME=$(git tag -l --format='%(contents:subject)' ${{ github.ref_name }})
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
git tag -l --format='%(contents:body)' ${{ github.ref_name }} >> ./release.md
- name: Build a changelog
run: ./infra/scripts/prepare_release_msg.sh >> ./release.md
- name: Upload changelog artifact
uses: actions/upload-artifact@v4
with:
name: changelog
path: ./release.md
retention-days: 0
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }} - ${{ env.RELEASE_NAME }}
body_path: ./release.md
draft: true
prerelease: true
- 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/debian.zip
asset_name: shellunity_${{github.ref_name}}.deb.zip
asset_content_type: application/zip