Skip to content

Commit

Permalink
Incremental Releasing (#359)
Browse files Browse the repository at this point in the history
* changes on actions job

* [Gradle Release Plugin] - new version commit:  '3.9.2'.

* adjusting

* adjusting artifacts upload

* push only amd64 images

* adjusting host artifacts retrieve

* logs

* fixing command

* adjusting

* adjusting release notes be to compliance with  https://keepachangelog.com/en/1.0.0/

* notes

* set app version

* set app version

* adjusting release header

* fixing when tag already exists

* adjusting release validator

* adjusting release validator

* adjusting release validator

* bump

* validating release

* validating release

* new try

* new try

* bump build

* fixing output

* bump

* adjusting command

* adjusting

* bump

* adjusting release for arm

* speed up image release for testing

* no need to checkout

* no need to download all refs

* no need to download all refs

* fixing artifacts

* removing unnecessary code

* bump version
  • Loading branch information
mageddo authored Mar 13, 2023
1 parent f503213 commit 63d0bdc
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 113 deletions.
88 changes: 78 additions & 10 deletions .github/workflows/actions-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,95 @@ permissions:

env:
CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }}
# github token to deploy the binary
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

jobs:
cd:
primary_release:
runs-on: ubuntu-latest
outputs:
APP_VERSION: ${{ steps.set_app_version.outputs.APP_VERSION }}
steps:
- name: Explain
run: |
echo "Bump version, build, generate github release, push docker images and the docs"
echo "Releases the Jar and Linux AMD64 version"
- name: Checkout code
uses: actions/checkout@v3

- name: Set app version
id: set_app_version
run: ./gradlew setVersionOnActions

- name: Jar and Linux AMD64 Release
run: |
mkdir -p ./build/ \
&& docker-compose -f docker-compose-deploy.yml up --build --force-recreate --exit-code-from deploy deploy \
&& ls -lhS ./build/*
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: native-image-source
path: ./build/artifacts/native-image-source/dns-proxy-server.jar

- name: Latest version changelog extraction
uses: kemayo/actions-recent-changelog@v1
with:
input: RELEASE-NOTES.md
output: VERSION-RELEASE-NOTES.md
- name: Check Release Notes
run: cat ./VERSION-RELEASE-NOTES.md

- name: Github release
uses: softprops/action-gh-release@v1
with:
fetch-depth: '0'
tag_name: ${{ env.APP_VERSION }}
prerelease: true
body_path: VERSION-RELEASE-NOTES.md
files: |
./build/compressed-artifacts/*
linux_arm_release:
runs-on: ubuntu-latest
needs: primary_release
env:
APP_VERSION: ${{ needs.primary_release.outputs.APP_VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Check app version
run: echo "$APP_VERSION"

- uses: actions/download-artifact@v3
with:
name: native-image-source
path: ./build/artifacts/native-image-source/

- name: Configure Qemu
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

- name: Deploy
run: docker-compose -f docker-compose-deploy.yml up --build --force-recreate --exit-code-from deploy deploy
env:
# github token to deploy the binary
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Linux Arm Release
run: |
echo "app version=$APP_VERSION" &&\
tree -h ./build/ &&\
docker-compose -f docker-compose-deploy.yml run deploy bash -c '
/bin/builder.bash deploy-arm &&\
echo "> Copying files to the host" &&\
cp -rv /app/build/compressed-artifacts /host/build/ &&\
echo "Linux arm64 is done!"
' &&\
tree -h ./build/
# Release details will be provided by primary-release
- name: Github release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.APP_VERSION }}
append_body: true
body: ''
files: |
./build/compressed-artifacts/*
2 changes: 1 addition & 1 deletion Dockerfile.builder.linux-aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY ./build/artifacts/native-image-source/ /app/build
ENV JAVA_TOOL_OPTIONS='-Djdk.lang.Process.launchMechanism=fork'
RUN uname -m && ls -lha &&\
native-image -Djdk.lang.Process.launchMechanism=fork -J-Djdk.lang.Process.launchMechanism=fork \
-jar dns-proxy-server.jar
-jar dns-proxy-server.jar dns-proxy-server

RUN ls -lhS &&\
mkdir -p ./artifacts/linux-aarch64 &&\
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ or via docker looking at [Dockerhub images][3].

Basic running it on Linux or Mac
```bash
$ curl -s -L https://github.com/mageddo/dns-proxy-server/releases/download/3.9.1/dns-proxy-server-linux-amd64-3.9.1.tgz | tar -vzx &&\
$ curl -s -L https://github.com/mageddo/dns-proxy-server/releases/download/3.9.2/dns-proxy-server-linux-amd64-3.9.2.tgz | tar -vzx &&\
sudo ./dns-proxy-server
```

Expand Down Expand Up @@ -74,4 +74,3 @@ Or via QR code
[5]: http://mageddo.github.io/dns-proxy-server/latest/en/1-getting-started/running-it/
[6]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PYFAZCXL442B6&source=url
[7]: https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif

Loading

0 comments on commit 63d0bdc

Please sign in to comment.