Skip to content

Commit

Permalink
Update main.yml , setup nightly build packages VS latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
benlabbe authored Nov 9, 2023
1 parent f0b5d8e commit e07957e
Showing 1 changed file with 38 additions and 56 deletions.
94 changes: 38 additions & 56 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:

jobs:

#========================================================================
debian11_qhttpserver:
name: "Build the package for Debian 11"
runs-on: ubuntu-latest
Expand All @@ -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
Expand All @@ -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 }}

0 comments on commit e07957e

Please sign in to comment.