OpenKernel 3.0 has been released. #7
This file contains hidden or 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: Build & Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "version.txt" | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Read version | |
| id: version | |
| run: | | |
| VERSION=$(cat version.txt) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Create OpenKernel package folder | |
| run: | | |
| mkdir -p package/OpenKernel | |
| rsync -av \ | |
| --exclude='.git' \ | |
| --exclude='.github' \ | |
| --exclude='version.txt' \ | |
| --exclude='package' \ | |
| --exclude='install_pkg.sh' \ | |
| --exclude='link.ld' \ | |
| --exclude='Makefile' \ | |
| --exclude='notes.txt' \ | |
| ./ package/OpenKernel/ | |
| cp install_pkg.sh package/ | |
| cp link.ld package/ | |
| cp Makefile package/ | |
| cp notes.txt package/ | |
| - name: Create ZIP package | |
| run: | | |
| cd package | |
| zip -r OpenKernel_${{ steps.version.outputs.version }}.zip OpenKernel install_pkg.sh link.ld Makefile notes.txt | |
| - name: Generate Changelog (version.txt based) | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| VERSION_COMMITS=$(git log --pretty=format:"%H" -- version.txt) | |
| HASHES=($VERSION_COMMITS) | |
| if [ ${#HASHES[@]} -lt 2 ]; then | |
| COMMITS=$(git log --pretty=format:"- %s") | |
| else | |
| CURRENT=${HASHES[0]} | |
| PREVIOUS=${HASHES[1]} | |
| COMMITS=$(git log $PREVIOUS..$CURRENT --pretty=format:"- %s") | |
| fi | |
| echo "## 🕒 Changes:" > CHANGELOG.md | |
| echo "" >> CHANGELOG.md | |
| echo "$COMMITS" >> CHANGELOG.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: openkernel${{ steps.version.outputs.version }} | |
| name: OpenKernel ${{ steps.version.outputs.version }} | |
| body_path: CHANGELOG.md | |
| files: | | |
| package/OpenKernel_${{ steps.version.outputs.version }}.zip |