Compare commits
No commits in common. "0f573de3e4c77644f99d38c633bf18fb7591b091" and "c7ba9b25b3fac64e9677f09040aca9a9209e24a8" have entirely different histories.
0f573de3e4
...
c7ba9b25b3
3 changed files with 47 additions and 57 deletions
|
@ -1,8 +1,6 @@
|
|||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
@ -27,7 +25,50 @@ jobs:
|
|||
with:
|
||||
name: test
|
||||
path: target/nextest/ci/junit.xml
|
||||
- name: 🔗 Artifactview PR comment
|
||||
if: ${{ always() && github.event_name == 'pull_request' }}
|
||||
|
||||
release:
|
||||
runs-on: cimaster-latest
|
||||
needs: test
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
steps:
|
||||
- name: 👁️ Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: ⚒️ Build application
|
||||
run: |
|
||||
curl -X POST https://av.thetadev.de/.well-known/api/prComment -H "Content-Type: application/json" --data "{\"url\": \"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\", \"pr\": ${{ github.event.number }}, \"artifact_titles\": {\"test\":\"🧪 Test report\"}}"
|
||||
PKG_CONFIG_SYSROOT_DIR=/usr/x86_64-linux-gnu cargo build --release --target x86_64-unknown-linux-gnu
|
||||
PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo build --release --target aarch64-unknown-linux-gnu
|
||||
- name: 🐋 Build docker image
|
||||
uses: https://code.thetadev.de/ThetaDev/action-kaniko@v1
|
||||
with:
|
||||
image: thetadev256/artifactview
|
||||
username: thetadev256
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
tag: ${{ github.ref_name }}
|
||||
tag_with_latest: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
platforms: "linux/amd64,linux/arm64"
|
||||
|
||||
- name: Prepare release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
run: |
|
||||
mkdir dist
|
||||
tar -cJf dist/artifactview-x86_64-${{ github.ref_name }}.tar.xz -C target/x86_64-unknown-linux-gnu/release artifactview
|
||||
tar -cJf dist/artifactview-aarch64-${{ github.ref_name }}.tar.xz -C target/aarch64-unknown-linux-gnu/release artifactview
|
||||
|
||||
{
|
||||
echo 'CHANGELOG<<END_OF_FILE'
|
||||
awk 'BEGIN{RS="(^|\n)## [^\n]+\n*"} NR==2 { print }' CHANGELOG.md
|
||||
echo END_OF_FILE
|
||||
} >> "$GITHUB_ENV"
|
||||
|
||||
- name: 🎉 Publish release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
title: "artifactview ${{ github.ref_name }}"
|
||||
body: "${{ env.CHANGELOG }}"
|
||||
files: dist/*
|
||||
|
||||
- name: 🚀 Deploy to server
|
||||
run: |
|
||||
curl -s -H "Authorization: Bearer ${{ secrets.THETADEV_DE_WATCHTOWER_TOKEN }}" https://watchtower.thetadev.de/v1/update
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: cimaster-latest
|
||||
steps:
|
||||
- name: 👁️ Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: ⚒️ Build application
|
||||
run: |
|
||||
PKG_CONFIG_SYSROOT_DIR=/usr/x86_64-linux-gnu cargo build --release --target x86_64-unknown-linux-gnu
|
||||
PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo build --release --target aarch64-unknown-linux-gnu
|
||||
- name: 🐋 Build docker image
|
||||
uses: https://code.thetadev.de/ThetaDev/action-kaniko@v1
|
||||
with:
|
||||
image: thetadev256/artifactview
|
||||
username: thetadev256
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
tag: ${{ github.ref_name }}
|
||||
tag_with_latest: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
platforms: "linux/amd64,linux/arm64"
|
||||
|
||||
- name: Prepare release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
run: |
|
||||
mkdir dist
|
||||
tar -cJf dist/artifactview-x86_64-${{ github.ref_name }}.tar.xz -C target/x86_64-unknown-linux-gnu/release artifactview
|
||||
tar -cJf dist/artifactview-aarch64-${{ github.ref_name }}.tar.xz -C target/aarch64-unknown-linux-gnu/release artifactview
|
||||
|
||||
{
|
||||
echo 'CHANGELOG<<END_OF_FILE'
|
||||
awk 'BEGIN{RS="(^|\n)## [^\n]+\n*"} NR==2 { print }' CHANGELOG.md
|
||||
echo END_OF_FILE
|
||||
} >> "$GITHUB_ENV"
|
||||
|
||||
- name: 🎉 Publish release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
title: "artifactview ${{ github.ref_name }}"
|
||||
body: "${{ env.CHANGELOG }}"
|
||||
files: dist/*
|
||||
|
||||
- name: 🚀 Deploy to server
|
||||
run: |
|
||||
curl -s -H "Authorization: Bearer ${{ secrets.THETADEV_DE_WATCHTOWER_TOKEN }}" https://watchtower.thetadev.de/v1/update
|
|
@ -82,7 +82,7 @@ artifacts).
|
|||
- name: 🔗 Artifactview PR comment
|
||||
if: ${{ always() && github.event_name == 'pull_request' }}
|
||||
run: |
|
||||
curl -X POST https://av.thetadev.de/.well-known/api/prComment -H "Content-Type: application/json" --data "{\"url\": \"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\", \"pr\": ${{ github.event.number }}}"
|
||||
curl -X POST https://av.thetadev.de/.well-known/api/prComment -H "Content-Type: application/json" --data "{\"url\": \"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\", pr: ${{ github.event.number }}}"
|
||||
```
|
||||
|
||||
## API
|
||||
|
|
Loading…
Reference in a new issue