forked from nikhilm/qhttpserver
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update main.yml , setup nightly build packages VS latest release
- Loading branch information
Showing
1 changed file
with
38 additions
and
56 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ env: | |
|
||
jobs: | ||
|
||
#======================================================================== | ||
debian11_qhttpserver: | ||
name: "Build the package for Debian 11" | ||
runs-on: ubuntu-latest | ||
|
@@ -31,46 +32,35 @@ jobs: | |
haskell: true | ||
large-packages: false | ||
swap-storage: true | ||
|
||
# Install the cosign tool except on PR | ||
# https://github.com/sigstore/cosign-installer | ||
- name: Install cosign | ||
if: github.event_name != 'pull_request' | ||
uses: sigstore/cosign-installer@main | ||
with: | ||
cosign-release: 'v1.4.0' | ||
|
||
- name: Build image | ||
run: docker build -f ./Dockerfile-debian11 -t aymara/qhttpserver-debian11:build . | ||
- name: Extract package and version number from docker iamge | ||
- name: Extract package and version number from docker image | ||
id: extract | ||
shell: bash | ||
run: | | ||
dockerImage="aymara/qhttpserver-debian11:build" | ||
packageDir="/usr/share/apps/qhttpserver/packages/" | ||
cicd/extract_package.sh $dockerImage $packageDir $GITHUB_OUTPUT | ||
- name: Create release | ||
uses: ncipollo/[email protected] | ||
id: create_release | ||
with: | ||
draft: false | ||
prerelease: false | ||
name: ${{ steps.extract.outputs.verion }} | ||
tag: ${{ steps.extract.outputs.version }} | ||
allowUpdates: true | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Upload package | ||
uses: actions/upload-release-asset@v1 | ||
- name: Upload nightly build package | ||
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
shell: bash | ||
run: | | ||
tagName=${{ steps.extract.outputs.version }}-nightly | ||
gh release create --prerelease ${tagName} || /bin/true | ||
gh release upload ${tagName} --clobber ./${{ steps.extract.outputs.filename }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload release package | ||
uses: softprops/action-gh-release@v1 | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./${{ steps.extract.outputs.filename }} | ||
asset_name: ${{ steps.extract.outputs.filename }} | ||
asset_content_type: application/vnd.debian.binary-package | ||
|
||
|
||
name: ${{ steps.extract.outputs.version }} | ||
files: | | ||
./${{ steps.extract.outputs.filename }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
#======================================================================== | ||
ubuntu22_04_qhttpserver: | ||
name: "Build the package for Ubuntu 22.04" | ||
runs-on: ubuntu-latest | ||
|
@@ -90,39 +80,31 @@ jobs: | |
haskell: true | ||
large-packages: false | ||
swap-storage: true | ||
# Install the cosign tool except on PR | ||
# https://github.com/sigstore/cosign-installer | ||
- name: Install cosign | ||
if: github.event_name != 'pull_request' | ||
uses: sigstore/cosign-installer@main | ||
with: | ||
cosign-release: 'v1.4.0' | ||
- name: Build image | ||
run: docker build -f ./Dockerfile-ubuntu22.04 -t aymara/qhttpserver-ubuntu22.04:build . | ||
- name: Extract package and version number from docker iamge | ||
- name: Extract package and version number from docker image | ||
id: extract | ||
shell: bash | ||
run: | | ||
dockerImage="aymara/qhttpserver-ubuntu22.04:build" | ||
packageDir="/usr/share/apps/qhttpserver/packages/" | ||
cicd/extract_package.sh $dockerImage $packageDir $GITHUB_OUTPUT | ||
- name: Create release | ||
uses: ncipollo/[email protected] | ||
id: create_release | ||
with: | ||
draft: false | ||
prerelease: false | ||
name: ${{ steps.extract.outputs.verion }} | ||
tag: ${{ steps.extract.outputs.version }} | ||
allowUpdates: true | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Upload package | ||
uses: actions/upload-release-asset@v1 | ||
- name: Upload nightly build package | ||
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
shell: bash | ||
run: | | ||
tagName=${{ steps.extract.outputs.version }}-nightly | ||
gh release create --prerelease ${tagName} || /bin/true | ||
gh release upload ${tagName} --clobber ./${{ steps.extract.outputs.filename }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload release package | ||
uses: softprops/action-gh-release@v1 | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./${{ steps.extract.outputs.filename }} | ||
asset_name: ${{ steps.extract.outputs.filename }} | ||
asset_content_type: application/vnd.debian.binary-package | ||
name: ${{ steps.extract.outputs.version }} | ||
files: | | ||
./${{ steps.extract.outputs.filename }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|