Reviewed-on: #1 Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #1.
This commit is contained in:
28
.gitea/workflows/cd.yaml
Normal file
28
.gitea/workflows/cd.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
name: CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- run: npm ci
|
||||
- name: Increment tag
|
||||
id: increment-tag
|
||||
uses: ./
|
||||
with:
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
- name: Push tag
|
||||
run: |
|
||||
git tag ${{ steps.increment-tag.outputs.new-tag }}
|
||||
git push origin ${{ steps.increment-tag.outputs.new-tag }}
|
||||
65
.gitea/workflows/ci.yaml
Normal file
65
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,65 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- run: npm ci
|
||||
- name: Format code
|
||||
run: npm run format
|
||||
- name: Typecheck
|
||||
run: npm run typecheck
|
||||
- name: Run test
|
||||
run: npm run test
|
||||
|
||||
check-dist:
|
||||
name: Check Dist
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- run: npm ci
|
||||
- run: mv dist dist_orig
|
||||
- run: npm run build
|
||||
- run: |
|
||||
original_hash=$(sha256sum dist_orig/index.js | cut -d' ' -f1)
|
||||
new_hash=$(sha256sum dist/index.js | cut -d' ' -f1)
|
||||
if [ "$original_hash" != "$new_hash" ]; then
|
||||
echo "Build is not up to date. Original hash: $original_hash, new hash: $new_hash"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dry-run:
|
||||
name: Dry-Run
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- run: npm ci
|
||||
- name: Increment tag
|
||||
id: increment-tag
|
||||
uses: ./
|
||||
with:
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
- name: Print new tag
|
||||
run: |
|
||||
if [ -z "${{ steps.increment-tag.outputs.new-tag }}" ]; then
|
||||
echo "No new tag found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "New tag: ${{ steps.increment-tag.outputs.new-tag }}"
|
||||
Reference in New Issue
Block a user