Skip to content

Commit

Permalink
Merge pull request #22 from theohbrothers/refactor/update-ci-files-20…
Browse files Browse the repository at this point in the history
…24-02-25

Refactor: Update CI files
  • Loading branch information
leojonathanoh authored Mar 2, 2024
2 parents 4aa248f + 456269b commit 0c3846c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 64 deletions.
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ categories:
- title: '🚀 Features'
labels:
- 'feature'
- title: '✨ Enhancements'
labels:
- 'enhancement'
- title: '🎚 Change'
labels:
- 'change'
- title: '🐛 Bug Fixes'
labels:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci-master-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Display system info (linux)
run: |
Expand All @@ -61,7 +61,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-4.1.4-${{ github.sha }}
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- name: 4.1.4-ubuntu-16.04 - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: variants/4.1.4-ubuntu-16.04
platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64,linux/s390x
Expand All @@ -119,7 +119,7 @@ jobs:
- name: 4.1.4-ubuntu-16.04 - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: variants/4.1.4-ubuntu-16.04
platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64,linux/s390x
Expand All @@ -132,7 +132,7 @@ jobs:

- name: 4.1.4-ubuntu-16.04 - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: variants/4.1.4-ubuntu-16.04
platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64,linux/s390x
Expand Down
1 change: 0 additions & 1 deletion generate/definitions/FILES.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Files' definition
$FILES = @(
'.github/workflows/ci-master-pr.yml'
'.github/release-drafter.yml'
'README.md'
)
52 changes: 0 additions & 52 deletions generate/templates/.github/release-drafter.yml.ps1

This file was deleted.

14 changes: 8 additions & 6 deletions generate/templates/.github/workflows/ci-master-pr.yml.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jobs:
'@

# Group variants by the package version
$groups = $VARIANTS | Group-Object -Property { $_['_metadata']['job_group_key'] } | Sort-Object { [version]$_.Name.Split('-')[0] } -Descending
$groups = @(
$VARIANTS | Group-Object -Property { $_['_metadata']['job_group_key'] } | Sort-Object { [version]$_.Name.Split('-')[0] } -Descending
)
$WORKFLOW_JOB_NAMES = $groups | % { "build-$( $_.Name.Replace('.', '-') )" }
foreach ($g in $groups) {
@"
Expand All @@ -46,7 +48,7 @@ foreach ($g in $groups) {
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Display system info (linux)
run: |
Expand All @@ -70,7 +72,7 @@ foreach ($g in $groups) {
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: `${{ runner.os }}-buildx-$( $g.Name )-`${{ github.sha }}
Expand Down Expand Up @@ -119,7 +121,7 @@ foreach ($v in $g.Group) {
- name: $( $v['tag' ] ) - Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: $( $v['build_dir_rel'] )
platforms: $( $v['_metadata']['platforms'] -join ',' )
Expand All @@ -133,7 +135,7 @@ foreach ($v in $g.Group) {
- name: $( $v['tag' ] ) - Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: $( $v['build_dir_rel'] )
platforms: $( $v['_metadata']['platforms'] -join ',' )
Expand All @@ -146,7 +148,7 @@ foreach ($v in $g.Group) {
- name: $( $v['tag' ] ) - Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: $( $v['build_dir_rel'] )
platforms: $( $v['_metadata']['platforms'] -join ',' )
Expand Down

0 comments on commit 0c3846c

Please sign in to comment.