Skip to content

Commit 77506d2

Browse files
committed
Update for release
1 parent 91ba858 commit 77506d2

File tree

6 files changed

+113
-15
lines changed

6 files changed

+113
-15
lines changed

.github/workflows/release.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*.*"
7+
8+
jobs:
9+
deploy_ghcr:
10+
if: github.repository == 'sapporo-wes/sio-serv'
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Login to GitHub Container Registry
23+
uses: docker/login-action@v3
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.repository_owner }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Build and push Docker image
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: .
33+
platforms: linux/amd64,linux/arm64
34+
push: true
35+
tags: |
36+
ghcr.io/${{ github.repository_owner }}/sio-serv:${{ github.ref_name }}
37+
ghcr.io/${{ github.repository_owner }}/sio-serv:latest
38+
39+
create_release:
40+
if: github.repository == 'sapporo-wes/sio-serv'
41+
runs-on: ubuntu-22.04
42+
steps:
43+
- name: Create GitHub Release
44+
run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --repo ${{ github.repository }} --generate-notes
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM node:22.7.0-bookworm
2+
3+
LABEL org.opencontainers.image.authors="Graduate School of Medicine and School of Medicine, Chiba University <[email protected]>"
4+
LABEL org.opencontainers.image.url="https://github.com/sapporo-wes/sio-serv"
5+
LABEL org.opencontainers.image.source="https://github.com/sapporo-wes/sio-serv/blob/main/Dockerfile"
6+
LABEL org.opencontainers.image.version="0.1.0"
7+
LABEL org.opencontainers.image.description="sapporo-wes/sio-serv, User-friendly web interface for executing workflows using the GA4GH Workflow Execution Service (WES) API."
8+
# LABEL org.opencontainers.image.licenses="CC-BY-4.0"
9+
10+
WORKDIR /app
11+
COPY package.json package-lock.json /app/
12+
13+
RUN npm ci
14+
15+
COPY . .
16+
17+
EXPOSE 3000
18+
19+
CMD ["sleep", "infinity"]

Dockerfile-dev

-12
This file was deleted.

compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
app:
33
build:
44
context: .
5-
dockerfile: Dockerfile-dev
5+
dockerfile: Dockerfile
66
image: sio-serv-app
77
container_name: sio-serv-app
88
volumes:

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "sio-serv",
3-
"private": true,
4-
"version": "0.0.0",
3+
"version": "0.1.0",
54
"type": "module",
65
"scripts": {
76
"dev": "vite",

release.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
set -euxo pipefail
3+
4+
if [[ $# -lt 1 ]]; then
5+
echo "Usage: $0 <new_version>"
6+
exit 1
7+
fi
8+
9+
PREV_VERSION=$(git describe --abbrev=0 --tags)
10+
NEW_VERSION=$1
11+
12+
read -p "Update version from $PREV_VERSION to $NEW_VERSION? (y/n): " YN
13+
14+
if [[ "$YN" != "y" ]]; then
15+
echo "Aborted."
16+
exit 1
17+
fi
18+
19+
NOW_BRANCH=$(git rev-parse --abbrev-ref HEAD)
20+
21+
if [[ "$NOW_BRANCH" != "main" ]]; then
22+
echo "You must be on the main branch."
23+
git checkout main
24+
fi
25+
26+
echo "Rewrite version in files."
27+
sed -i "s/version=\"$PREV_VERSION\"/version=\"$NEW_VERSION\"/g" Dockerfile
28+
# sed -i "s/sio-serv:$PREV_VERSION/sio-serv:$NEW_VERSION/g" compose.yml
29+
sed -i "s/\"version\": \"$PREV_VERSION\"/\"version\": \"$NEW_VERSION\"/g" package.json
30+
31+
echo "Commit and push changes."
32+
# git add Dockerfile compose.yml package.json
33+
git add Dockerfile package.json
34+
git commit -m "Update version to $NEW_VERSION"
35+
git push origin main
36+
37+
echo "Tag and push."
38+
git tag $NEW_VERSION
39+
git push origin $NEW_VERSION
40+
41+
echo "Done."
42+
43+
echo "Summary of changes:"
44+
git log --oneline --pretty=tformat:"%h %s" "$PREV_VERSION..$NEW_VERSION"
45+
46+
exit 0

0 commit comments

Comments
 (0)