Skip to content

Commit 9cb3b18

Browse files
committed
Fix versioning (#29)
1 parent 221e583 commit 9cb3b18

File tree

4 files changed

+126
-114
lines changed

4 files changed

+126
-114
lines changed

.github/workflows/main-be.yml

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
name: Construct Container
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
paths:
8-
- "backend/**"
9-
release:
10-
types:
11-
- published
12-
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "backend/**"
9+
release:
10+
types:
11+
- published
12+
workflow_dispatch:
1313

1414
jobs:
15-
build:
16-
runs-on: ubuntu-latest
17-
steps:
18-
- name: Checkout Codebase
19-
uses: actions/checkout@v4
20-
21-
- name: Login to GitHub Container Registry
22-
uses: docker/login-action@v3
23-
with:
24-
registry: ghcr.io
25-
username: soup-bowl
26-
password: ${{ secrets.CR_PAT }}
27-
28-
- name: Set up QEMU
29-
uses: docker/setup-qemu-action@v3
30-
31-
- name: Set up Docker Buildx
32-
id: buildx
33-
uses: docker/setup-buildx-action@v3
34-
35-
- name: Build for Edge
36-
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
37-
uses: docker/build-push-action@v5
38-
with:
39-
push: true
40-
tags: ghcr.io/soup-bowl/netscrape:edge
41-
platforms: >
42-
linux/amd64
43-
# linux/arm64
44-
context: "{{defaultContext}}:backend"
45-
cache-from: type=gha
46-
cache-to: type=gha,mode=max
47-
48-
- name: Build for Production
49-
if: ${{ github.event_name == 'release' }}
50-
uses: docker/build-push-action@v5
51-
with:
52-
push: true
53-
tags: >
54-
ghcr.io/soup-bowl/netscrape:${{ github.event.release.tag_name }},
55-
ghcr.io/soup-bowl/netscrape:latest
56-
platforms: >
57-
linux/amd64
58-
# linux/arm64
59-
context: "{{defaultContext}}:backend"
60-
cache-from: type=gha
61-
cache-to: type=gha,mode=max
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Codebase
19+
uses: actions/checkout@v4
20+
21+
- name: Login to GitHub Container Registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: soup-bowl
26+
password: ${{ secrets.CR_PAT }}
27+
28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
id: buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: Build for Edge
36+
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
37+
uses: docker/build-push-action@v5
38+
with:
39+
push: true
40+
tags: ghcr.io/soup-bowl/netscrape:edge
41+
platforms: >
42+
linux/amd64
43+
# linux/arm64
44+
context: "{{defaultContext}}:backend"
45+
cache-from: type=gha
46+
cache-to: type=gha,mode=max
47+
48+
- name: Build for Production
49+
if: ${{ github.event_name == 'release' }}
50+
uses: docker/build-push-action@v5
51+
with:
52+
push: true
53+
tags: >
54+
ghcr.io/soup-bowl/netscrape:${{ github.event.release.tag_name }},
55+
ghcr.io/soup-bowl/netscrape:latest
56+
platforms: >
57+
linux/amd64
58+
# linux/arm64
59+
context: "{{defaultContext}}:backend"
60+
cache-from: type=gha
61+
cache-to: type=gha,mode=max

.github/workflows/main-fe.yml

Lines changed: 67 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,74 @@
11
name: 🚀 Deploy!
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
paths:
8-
- "frontend/**"
9-
release:
10-
types:
11-
- published
12-
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "frontend/**"
9+
release:
10+
types:
11+
- published
12+
workflow_dispatch:
1313

1414
concurrency:
15-
group: "pages"
16-
cancel-in-progress: true
15+
group: "pages"
16+
cancel-in-progress: true
1717

1818
jobs:
19-
build:
20-
environment:
21-
name: github-pages
22-
url: ${{ steps.deployment.outputs.page_url }}
23-
24-
runs-on: ubuntu-latest
25-
26-
permissions:
27-
contents: read
28-
deployments: write
29-
30-
steps:
31-
- uses: actions/checkout@v4
32-
with:
33-
fetch-depth: 0
34-
35-
- uses: sonarsource/sonarqube-scan-action@master
36-
env:
37-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
38-
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
39-
40-
- name: 🏗 Setup Node.js
41-
uses: actions/setup-node@v4
42-
with:
43-
node-version: 20.x
44-
45-
- name: Set Version
46-
run: |
47-
VERSION=$(jq -r '.version' frontend/package.json)
48-
GIT_COMMIT=$(git rev-parse --short HEAD)
49-
echo "VITE_VER=${VERSION}-${GIT_COMMIT}" >> frontend/.env.production
50-
51-
- name: 📦 Build Site
52-
run: cd frontend && npm ci && npm run build:ion
53-
54-
- name: 🚛 Publish Site
55-
uses: cloudflare/pages-action@v1
56-
with:
57-
apiToken: ${{ secrets.CF_API_TOKEN }}
58-
accountId: ${{ secrets.CF_ACCOUNT_ID }}
59-
projectName: discog
60-
directory: ./frontend/dist
61-
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
62-
branch: ${{ github.event_name == 'release' && 'main' || 'not-hotdog' }}
19+
build:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
24+
runs-on: ubuntu-latest
25+
26+
permissions:
27+
contents: read
28+
deployments: write
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- uses: sonarsource/sonarqube-scan-action@master
36+
env:
37+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
38+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
39+
40+
- name: 🏗 Setup Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 20.x
44+
45+
- name: Identify version
46+
if: github.event_name == 'release'
47+
id: get_version
48+
uses: battila7/get-version-action@v2
49+
50+
- name: change version in NPM
51+
if: github.event_name == 'release'
52+
uses: reedyuk/npm-version@1.2.2
53+
with:
54+
version: ${{ steps.get_version.outputs.version-without-v }}
55+
github-tag-version: "false"
56+
57+
- name: Set Version
58+
run: |
59+
VERSION=$(jq -r '.version' frontend/package.json)
60+
GIT_COMMIT=$(git rev-parse --short HEAD)
61+
echo "VITE_VER=${VERSION}-${GIT_COMMIT}" >> frontend/.env.production
62+
63+
- name: 📦 Build Site
64+
run: cd frontend && npm ci && npm run build:ion
65+
66+
- name: 🚛 Publish Site
67+
uses: cloudflare/pages-action@v1
68+
with:
69+
apiToken: ${{ secrets.CF_API_TOKEN }}
70+
accountId: ${{ secrets.CF_ACCOUNT_ID }}
71+
projectName: discog
72+
directory: ./frontend/dist
73+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
74+
branch: ${{ github.event_name == 'release' && 'main' || 'not-hotdog' }}

frontend/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "localib",
33
"description": "Collects your Discogs library for offline usage",
44
"private": true,
5-
"version": "0.1.6",
5+
"version": "develop",
66
"type": "module",
77
"scripts": {
88
"dev": "vite",

0 commit comments

Comments
 (0)