-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0 parents
commit 6a748f5
Showing
7 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Build and release | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: | ||
- '*' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: Release ipk to GitHub Releases | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
needs: build | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ env.ARTIFACT_NAME }} | ||
|
||
- name: View content | ||
run: ls -R | ||
|
||
- name: Set env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Create master push pre-release | ||
if: ${{ env.RELEASE_VERSION == 'master' }} | ||
id: create_pre_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: push-run-${{ github.run_number }} | ||
name: push-run-${{ github.run_number }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: true | ||
artifacts: ./*/*.ipk | ||
|
||
- name: Create tagged release | ||
if: ${{ env.RELEASE_VERSION != 'master' }} | ||
id: create_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ env.RELEASE_VERSION }} | ||
name: ${{ env.RELEASE_VERSION }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: false | ||
artifacts: ./*/*.ipk | ||
|
||
build: | ||
name: Build IPK package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get GitHub Build Number (ENV) | ||
id: get_buildno | ||
run: echo "GITHUBBUILDNUMBER=${{ github.run_number }}" >> $GITHUB_ENV | ||
continue-on-error: true | ||
|
||
- name: Make artifact name | ||
id: make_artifactname | ||
run: | | ||
ARTIFACT_NAME="EXAMPLE-IPK-BUILD-${{ github.run_number }}" | ||
echo "${ARTIFACT_NAME}" | ||
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV | ||
- name: Build ipk package | ||
run: make | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.ARTIFACT_NAME }} | ||
path: ./ipk/*.ipk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ipk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
NAME = $(shell cat ./control/control | grep Package | cut -d" " -f2) | ||
ARCH = $(shell cat ./control/control | grep Architecture | cut -d" " -f2) | ||
VERSION = $(shell cat ./control/control | grep Version | cut -d" " -f2) | ||
IPK_NAME = "${NAME}_${VERSION}_${ARCH}.ipk" | ||
|
||
all: | ||
|
||
mkdir -p ipk | ||
echo "2.0" > ipk/debian-binary | ||
cp -r data ipk/ | ||
cp -r control ipk/ | ||
cd ipk/control && tar czvf ../control.tar.gz . | ||
cd ipk/data && tar czvf ../data.tar.gz . | ||
cd ipk/ && tar czvf "./${IPK_NAME}" ./control.tar.gz ./data.tar.gz ./debian-binary | ||
|
||
clean: | ||
rm -rf ipk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Example IPK builder | ||
This repo is meant as an example regarding workflows and IPK's. | ||
|
||
The `Makefile` is used to build an IPK from the available data. The workflow file is meant to create a new release as soon as a new tag is pushed to the repository. It will thus trigger building the IPK and attaching it to the release. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Package: test-package | ||
Version: 0.0.1 | ||
Maintainer: Your Name <user@example.com> | ||
Description: This is just a test package | ||
Architecture: armv7-3.2 |
Empty file.
Empty file.