Skip to content

Commit cb90993

Browse files
committed
ci: build workflow
1 parent 6daf440 commit cb90993

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build and Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
Build:
8+
name: Build
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v2
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
- name: Login to GitHub Container Registry
23+
uses: docker/login-action@v2
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.repository_owner }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Get Next Version
30+
id: semver
31+
uses: ietf-tools/semver-action@v1
32+
with:
33+
token: ${{ github.token }}
34+
branch: main
35+
36+
- name: Set Next Version Env Var
37+
run: |
38+
echo "NEXT_VERSION=$nextStrict" >> $GITHUB_ENV
39+
40+
- name: Create Draft Release
41+
uses: ncipollo/release-action@v1
42+
with:
43+
prerelease: true
44+
draft: false
45+
commit: ${{ github.sha }}
46+
tag: ${{ env.NEXT_VERSION }}
47+
name: ${{ env.NEXT_VERSION }}
48+
body: '*pending*'
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Build and push Docker images
52+
uses: docker/build-push-action@v3
53+
with:
54+
context: .
55+
file: Dockerfile
56+
platforms: linux/amd64,linux/arm64,linux/arm/v7
57+
push: true
58+
tags: |
59+
ghcr.io/requarks/wiki-update-companion:latest
60+
ghcr.io/requarks/wiki-update-companion:${{ env.NEXT_VERSION }}
61+
62+
- name: Update CHANGELOG
63+
id: changelog
64+
uses: Requarks/changelog-action@v1
65+
with:
66+
token: ${{ github.token }}
67+
tag: ${{ env.NEXT_VERSION }}
68+
writeToFile: false
69+
70+
- name: Create Release
71+
uses: ncipollo/release-action@v1
72+
with:
73+
allowUpdates: true
74+
draft: false
75+
tag: ${{ env.NEXT_VERSION }}
76+
name: ${{ env.NEXT_VERSION }}
77+
body: ${{ steps.changelog.outputs.changelog }}
78+
token: ${{ secrets.GITHUB_TOKEN }}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"yaml.schemas": {
3+
"https://json.schemastore.org/github-workflow.json": "file:///home/dev/_/wiki-update-companion/.github/workflows/build.yml"
4+
}
5+
}

0 commit comments

Comments
 (0)