Skip to content

Commit

Permalink
ci(tools): prepare for commit-release usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ADRFranklin committed May 11, 2024
1 parent 969a491 commit 833b47a
Show file tree
Hide file tree
Showing 89 changed files with 65 additions and 886 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/loc
RUN wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly \
&& chmod +x /usr/local/bin/earthly \
&& /usr/local/bin/earthly bootstrap --with-autocomplete
# Make sure better-commits exists
RUN npm install -g better-commits
# Make sure better-commits and semantic-release exists
RUN npm install -g better-commits semantic-release
7 changes: 2 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@ jobs:
- if: ${{ github.ref == format('refs/heads/{0}', 'dev') }}
run: echo "IMAGE_LABEL=nightly" >> $GITHUB_ENV

- if: ${{ github.ref == format('refs/heads/{0}', 'preview') }}
run: echo "IMAGE_LABEL=staging" >> $GITHUB_ENV

- if: ${{ env.IMAGE_LABEL == '' }}
run: echo "IMAGE_LABEL=$BRANCH_NAME" >> $GITHUB_ENV

- run: echo "SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV

- name: Run build
run: earthly --ci --push +build-all --COMMIT=$SHORT_SHA --LABEL=$IMAGE_LABEL
- name: Build
run: earthly --ci --push +build-all --COMMIT_SHA=$SHORT_SHA --LABEL=$IMAGE_LABEL
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/meow-npm-8.1.2-bcfe48d4f3-bc23bf1b44.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 8 additions & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ build:
build-image:
ARG TARGETPLATFORM
ARG TARGETARCH
ARG TAG=latest
ARG --required COMMIT
ARG LABEL=unknown
ARG --required COMMIT_SHA
FROM --platform=$TARGETPLATFORM scratch
ENV DATA_DIR=/data
ENV HTTP_ADDR=0.0.0.0
Expand All @@ -33,5 +33,9 @@ build-image:
(+build/releases/petio-linuxstatic-$TARGETARCH) ./petio
VOLUME ["/data"]
ENTRYPOINT ["/petio"]
SAVE IMAGE --push ghcr.io/petio-team/petio:$TAG
SAVE IMAGE --push ghcr.io/petio-team/petio:$COMMIT
SAVE IMAGE --push ghcr.io/petio-team/petio:$LABEL
SAVE IMAGE --push ghcr.io/petio-team/petio:$COMMIT_SHA

release:
FROM node:20.11.1-alpine3.19
RUN npx semantic-release -d -b dev
10 changes: 9 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ tasks:
- yarn workspace frontend run build
- yarn workspace api run build

dev:api:
cmds:
- yarn workspace api run watch

dev:fe:
cmds:
- yarn workspace frontend run start

ci:
cmds:
- earthly --ci --push +build-all --COMMIT={{ .COMMIT_SHA }} --LABEL=nightly
- earthly +build-all --COMMIT_SHA={{ .COMMIT_SHA }} --LABEL=nightly
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,22 @@
],
"outputPath": "dist/releases"
},
"release": {
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/github",
{
"assets": [
"dist/releases/**"
]
}
]
]
},
"packageManager": "yarn@3.2.1"
}

0 comments on commit 833b47a

Please sign in to comment.