Skip to content

Commit 713e20b

Browse files
authored
Release tarballs to GitHub Releases (#31)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 8c6c444 commit 713e20b

5 files changed

Lines changed: 48 additions & 1 deletion

File tree

.github/workflows/cd.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Std CD
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
concurrency:
9+
group: std-cd-${{ github.workflow }}-${{ github.ref_type }}
10+
cancel-in-progress: false
11+
12+
permissions:
13+
contents: write
14+
packages: write
15+
16+
jobs:
17+
package:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- run: sudo snap install jsonschema
21+
- uses: actions/checkout@v4
22+
- run: make lint
23+
- run: make test
24+
- run: make dist
25+
26+
- run: gh config set prompt disabled
27+
env:
28+
GH_TOKEN: ${{ github.token }}
29+
30+
- name: Perform Tag Release
31+
run: |
32+
gh release create ${{ github.ref_name }} --draft=false --title ${{ github.ref_name }} --target "$GITHUB_SHA" --generate-notes
33+
gh release upload --clobber ${{ github.ref_name }} dist/*.zip dist/*.tar.gz
34+
if: github.ref_type == 'tag'
35+
env:
36+
GH_TOKEN: ${{ github.token }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Std
1+
name: Std CI
22

33
on:
44
schedule:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
22
/build
3+
/dist

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ RMRF ?= rm -rf
1010
SCHEMAS = $(shell find schemas/ -type f -name '*.json')
1111
TESTS = $(shell find test/ -type f -name '*.json')
1212

13+
VERSION = $(shell tr -d '\n\r' < VERSION)
14+
1315
all: common test
1416
$(JSONSCHEMA) fmt schemas meta --verbose
1517
$(JSONSCHEMA) fmt test --verbose --default-dialect "https://json-schema.org/draft/2020-12/schema"
@@ -38,3 +40,10 @@ include generate/iso/language/include.mk
3840
include generate/iso/country/include.mk
3941
external: $(EXTERNAL)
4042
generate: $(GENERATE)
43+
44+
.PHONY: dist
45+
dist:
46+
$(RMRF) $@
47+
$(MKDIRP) $@
48+
$(BSDTAR) -caf $@/sourcemeta-std-v$(VERSION).zip -s '|^schemas/||' --exclude '.DS_Store' schemas/* LICENSE
49+
$(BSDTAR) -czf $@/sourcemeta-std-v$(VERSION).tar.gz -s '|^schemas/||' --exclude '.DS_Store' schemas/* LICENSE

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1

0 commit comments

Comments
 (0)