Skip to content

Commit 0260656

Browse files
committed
Merge branch 'develop'
2 parents 69611fc + 27e5f0a commit 0260656

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

.github/workflows/publish.yml renamed to .github/workflows/release.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
1-
name: Publish
1+
name: Release
22

33
on:
44
push:
5-
branches:
6-
- main
75
tags:
86
- "v20*"
97

8+
permissions:
9+
contents: write
10+
packages: write
11+
1012
env:
1113
IMAGE_NAME: asciinema-server
1214

1315
jobs:
1416
publish:
1517
runs-on: ubuntu-24.04
16-
permissions:
17-
packages: write
18-
contents: read
1918

2019
steps:
2120
- uses: actions/checkout@v4
2221

2322
- name: Set up outputs
2423
id: vars
2524
run: |
25+
VERSION=$(echo "${{ github.ref_name }}" | sed -e 's/^v//')
2626
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
27-
# Change all uppercase to lowercase
2827
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
29-
IMAGE_TAG="${{ github.ref_name }}"
30-
# Strip "v" prefix from tag name
31-
[[ "${{ github.ref_type }}" == "tag" ]] && IMAGE_TAG=$(echo $IMAGE_TAG | sed -e 's/^v//')
32-
# Use Docker `latest` tag convention
33-
[ "$IMAGE_TAG" == "main" ] && IMAGE_TAG=latest
34-
VERSION="${{ github.sha }}"
35-
[[ "${{ github.ref_type }}" == "tag" ]] && VERSION="${{ github.ref_name }}"
36-
[[ "${{ github.ref_type }}" == "branch" ]] && VERSION="${{ github.ref_name }}-${{ github.sha }}"
28+
IMAGE_TAG=$VERSION
29+
echo VERSION=$VERSION >> $GITHUB_OUTPUT
3730
echo IMAGE_ID=$IMAGE_ID >> $GITHUB_OUTPUT
3831
echo IMAGE_TAG=$IMAGE_TAG >> $GITHUB_OUTPUT
39-
echo VERSION=$VERSION >> $GITHUB_OUTPUT
32+
33+
- name: Create the release
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
run: |
37+
gh release create ${{ github.ref_name }} --draft --verify-tag --title ${{ steps.vars.outputs.VERSION }}
4038
4139
- name: Set up Docker Buildx
4240
uses: docker/setup-buildx-action@v3
@@ -49,11 +47,11 @@ jobs:
4947
password: ${{ secrets.GITHUB_TOKEN }}
5048

5149
- name: Build image
52-
uses: docker/build-push-action@v5
50+
uses: docker/build-push-action@v6
5351
with:
5452
context: .
5553
push: true
56-
tags: ${{ steps.vars.outputs.IMAGE_ID }}:${{ steps.vars.outputs.IMAGE_TAG }}
54+
tags: ${{ steps.vars.outputs.IMAGE_ID }}:${{ steps.vars.outputs.IMAGE_TAG }},${{ steps.vars.outputs.IMAGE_ID }}:latest
5755
labels: runnumber=${{ github.run_id }}
5856
cache-from: type=gha
5957
cache-to: type=gha,mode=max

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ npm-debug.log
3636
/assets/node_modules/
3737

3838
.*
39+
!/.github/
40+
3941
/cache/
4042
/config/custom.exs
4143
/priv/native/

0 commit comments

Comments
 (0)