Skip to content

Commit

Permalink
update github actions to 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
GIC-de committed Aug 20, 2023
1 parent c1e4a5a commit a28e1cc
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ env:

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install dependencies
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
jobs:
build:
name: Publish Pages
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Generate Doxygen
uses: mattnotmitt/doxygen-action@v1
Expand Down
76 changes: 49 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,62 @@ on:
tags:
- 'v*'

env:
BUILD_TYPE: Release

jobs:
build:
release:
name: Create Release
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- name: Get Ref Names
id: ref_name
run: |
echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
with:
tag: ${{ steps.ref_name.outputs.SOURCE_TAG }}
body: "libdict ${{ steps.ref_name.outputs.SOURCE_TAG }}"

build:
name: Build Release ${{matrix.os}}
needs: [release]
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install dependencies
shell: bash
run: sudo apt install libcunit1-dev

- name: Get Ref Names
id: ref_name
run: |
echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set export SOURCE_DATE_EPOCH to git commit time
run: |
echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" >> $GITHUB_ENV
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
run: cmake -E make_directory ${{github.workspace}}/build

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DLIBDICT_VERSION=${{ steps.ref_name.outputs.SOURCE_TAG }}

- name: Build
working-directory: ${{github.workspace}}/build
Expand All @@ -40,27 +77,12 @@ jobs:
shell: bash
run: |
cpack -G DEB
zip libdict-debian *.deb
zip libdict-${{ matrix.os }}.zip *.deb
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Release ${{ github.ref }}
draft: true # need to manually publish
prerelease: false

- name: Upload libdict Debian Package
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/libdict-debian.zip
asset_name: libdict-debian.zip
asset_content_type: application/zip
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libdict-${{ matrix.os }}.zip
asset_name: libdict-${{ matrix.os }}.zip
tag: ${{ steps.ref_name.outputs.SOURCE_TAG }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ env:

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install dependencies
shell: bash
Expand Down

0 comments on commit a28e1cc

Please sign in to comment.