forked from dotenvx/dotenvx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
58 lines (53 loc) · 1.77 KB
/
Copy pathaction.yml
File metadata and controls
58 lines (53 loc) · 1.77 KB
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
name: commit-binary-to-github
description: commit binary to github repo - which triggers to npm publish
inputs:
version:
description: 'choose version'
required: true
default: 'v0.30.0'
platform:
description: 'choose platform'
required: true
default: 'darwin-arm64'
runs:
using: "composite"
steps:
- name: extract version
shell: bash
run: |
VERSION=${{inputs.version}}
CLEAN_VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "CLEAN_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV
- name: node
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: download and extract tarball
shell: bash
run: |
curl -L -o tarball.tar.gz https://github.com/dotenvx/dotenvx/releases/download/${{ env.VERSION }}/dotenvx-${{ env.CLEAN_VERSION }}-${{ inputs.platform }}.tar.gz
mkdir -p output
tar -xzvf tarball.tar.gz -C output --strip-components=1
- name: checkout target repo
uses: actions/checkout@v4
with:
repository: "dotenvx/dotenvx-${{ inputs.platform }}"
token: ${{ env.PERSONAL_ACCESS_TOKEN }}
path: "dotenvx-${{ inputs.platform }}"
- name: copy dotenvx binary to repo
shell: bash
run: |
mkdir -p dotenvx-${{ inputs.platform }}
cp -r output/* dotenvx-${{ inputs.platform }}/
- name: set version, commit, and push
shell: bash
run: |
cd dotenvx-${{ inputs.platform }}
npm version ${{ env.CLEAN_VERSION }} --no-git-tag-version
git config --global user.name 'motdotenv'
git config --global user.email 'mot@dotenv.org'
git add .
git commit -m "${{ env.VERSION }}"
git tag "${{ env.VERSION }}"
git push origin HEAD --tags