aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/release.yml
blob: e40422f79e95913cfdbd1f13dcdad3a9cfaf77cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Release

on:
  push:
    tags:
      - "v*.*.*"

permissions:
  contents: read

jobs:

  release:
    permissions:
      contents: write  # for softprops/action-gh-release to create GitHub release
    name: Build release binaries
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ ubuntu-latest ]
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Set the version
        run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
      - name: Set the platform
        run: echo "platform=$(tr '[A-Z]' '[a-z]' <<< $RUNNER_OS)" >> $GITHUB_ENV
      - name: Compile the project
        run: make clean && make
      - name: Build the artifact
        run: JANET_DIST_DIR=janet-${{ env.version }}-${{ env.platform }} make build/janet-${{ env.version }}-${{ env.platform }}-x64.tar.gz
      - name: Draft the release
        uses: softprops/action-gh-release@v1
        with:
          draft: true
          files: |
            build/*.gz
            build/janet.h
            build/c/janet.c
            build/c/shell.c

  release-arm:
    permissions:
      contents: write  # for softprops/action-gh-release to create GitHub release
    name: Build release binaries
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ macos-latest ]
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Set the version
        run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
      - name: Set the platform
        run: echo "platform=$(tr '[A-Z]' '[a-z]' <<< $RUNNER_OS)" >> $GITHUB_ENV
      - name: Compile the project
        run: make clean && make
      - name: Build the artifact
        run: JANET_DIST_DIR=janet-${{ env.version }}-${{ env.platform }} make build/janet-${{ env.version }}-${{ env.platform }}-aarch64.tar.gz
      - name: Draft the release
        uses: softprops/action-gh-release@v1
        with:
          draft: true
          files: |
            build/*.gz
            build/janet.h
            build/c/janet.c
            build/c/shell.c

  release-windows:
    permissions:
      contents: write  # for softprops/action-gh-release to create GitHub release
    name: Build release binaries for windows
    runs-on: windows-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: Setup MSVC
        uses: ilammy/msvc-dev-cmd@v1
      - name: Build the project
        shell: cmd
        run: build_win all
      - name: Draft the release
        uses: softprops/action-gh-release@v1
        with:
          draft: true
          files: |
            ./dist/*.zip
            ./*.zip
            ./*.msi

  release-cosmo:
    permissions:
      contents: write  # for softprops/action-gh-release to create GitHub release
    name: Build release binaries for Cosmo
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@master
      - name: create build folder
        run: |
          sudo mkdir -p /sc
          sudo chmod -R 0777 /sc
      - name: setup Cosmopolitan Libc
        run: bash ./.github/cosmo/setup
      - name: Set the version
        run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
      - name: Set the platform
        run: echo "platform=cosmo" >> $GITHUB_ENV
      - name: build Janet APE binary
        run: bash ./.github/cosmo/build
      - name: push binary to github
        uses: softprops/action-gh-release@v1
        with:
          draft: true
          files: |
            /sc/cosmocc/janet.com