Skip to content

Commit

Permalink
fix: Test release (#2)
Browse files Browse the repository at this point in the history
* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WI
  • Loading branch information
dwilkie authored Oct 11, 2024
1 parent 9e2872b commit ef0dc59
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 42 deletions.
61 changes: 22 additions & 39 deletions .github/workflows/skyetel.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
name: Skyetel

on: push
on:
push:
branches: "**"
tags: "v*"

defaults:
run:
working-directory: skyetel

jobs:
build:
name: Build
runs-on: ubuntu-latest

defaults:
run:
working-directory: skyetel

outputs:
matrix: ${{ steps.set-deployment-matrix.outputs.matrix }}
matrixLength: ${{ steps.set-deployment-matrix.outputs.matrixLength }}
packageMatrix: ${{ steps.set-deployment-matrix.outputs.packageMatrix }}
release: ${{ steps.set-deployment-matrix.outputs.deploy }}
release: ${{ steps.set-deployment-matrix.outputs.release }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -51,7 +54,6 @@ jobs:
matrix=$(echo $matrixSource | jq --arg branchName "$branchName" 'map(. | select((.branch==$branchName)) )')
echo "matrix={\"include\":$(echo $matrix)}" >> $GITHUB_OUTPUT
echo "matrixLength=$(echo $matrix | jq length)" >> $GITHUB_OUTPUT
echo "packageMatrix={\"platform\":[\"amd64\",\"arm64\"],\"include\":$(echo $matrix)}" >> $GITHUB_OUTPUT
echo "release=$(echo $matrix | jq '.[0].release')" >> $GITHUB_OUTPUT
release:
Expand All @@ -63,8 +65,6 @@ jobs:
release_tag: ${{ steps.release-please.outputs.tag_name }}
needs:
- build
strategy:
matrix: ${{fromJSON(needs.build.outputs.packageMatrix)}}

steps:
- name: Checkout
Expand All @@ -74,34 +74,18 @@ jobs:
id: release-please
with:
token: ${{ secrets.SOMLENG_PERSONAL_ACCESS_TOKEN }}
path: skyetel
config-file: skyetel/release-please-config.json
manifest-file: skyetel/.release-please-manifest.json

build-packages:
name: Build Packages
runs-on: ubuntu-latest
needs:
- build
- release
if: ${{ needs.release.outputs.release_created }}
strategy:
matrix: ${{fromJSON(needs.build.outputs.packageMatrix)}}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Packages
run: |
docker buildx build --output type=local,dest=build --platform linux/${{ matrix.platform }} .
upload-packages:
name: Upload Packages
runs-on: ubuntu-latest
needs:
- build-packages
- release
matrix: ${{ fromJSON(needs.build.outputs.matrix) }}
if: needs.build.outputs.matrixLength > 0
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -120,19 +104,17 @@ jobs:
images: |
ghcr.io/somleng/somleng-skyetel
tags: |
# set latest tag for main branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=beta,enable=${{ github.ref == format('refs/heads/{0}', 'develop') }}
type=raw,value=${{ needs.release.outputs.release_tag }}
type=ref,event=tag
type=raw,value=beta
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
context: skyetel
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -142,10 +124,10 @@ jobs:
runs-on: ubuntu-latest
needs:
- build
- upload-packages
if: ${{ needs.release.outputs.release_created }}
- build-packages
if: ${{ startsWith(github.ref_name, 'v') }}
strategy:
matrix: ${{fromJSON(needs.build.outputs.packageMatrix)}}
matrix: ${{fromJSON(needs.build.outputs.matrix)}}

steps:
- uses: actions/checkout@v4
Expand All @@ -158,3 +140,4 @@ jobs:
SENTRY_PROJECT: somleng-skyetel
with:
environment: ${{ matrix.environment }}
version: ${{ github.ref_name }}
3 changes: 3 additions & 0 deletions skyetel/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
3 changes: 0 additions & 3 deletions skyetel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ FROM public.ecr.aws/lambda/ruby:$RUBY_VERSION

COPY --from=build-image ${LAMBDA_TASK_ROOT} ${LAMBDA_TASK_ROOT}

RUN dnf update && \
dnf -y install postgresql-devel

ENV RUBY_YJIT_ENABLE=true

CMD [ "app.App::Handler.process" ]
15 changes: 15 additions & 0 deletions skyetel/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"include-component-in-tag": false,
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "ruby",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": false,
"package-name": "somleng-skyetel"
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
3 changes: 3 additions & 0 deletions skyetel/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module SomlengSkyetel
VERSION = "0.1.0".freeze
end

0 comments on commit ef0dc59

Please sign in to comment.