Skip to content

Commit 75b1e0c

Browse files
committed
attempting to create a new release
1 parent 38fc87b commit 75b1e0c

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Main
2+
23
on:
34
push:
45
branches: main
@@ -8,14 +9,11 @@ on:
89
jobs:
910
deploy:
1011
name: Main
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
matrix:
14-
os: [ubuntu-latest, macos-latest] # taking out windows-latest for now: ending issue
12+
runs-on: ubuntu-latest
1513

1614
permissions:
17-
id-token: write # Needed for auth with Deno Deploy
18-
contents: read # Needed to clone the repository
15+
id-token: write # Needed for auth with Deno Deploy
16+
contents: write # Needed to push updates and create a release
1917

2018
steps:
2119
- name: Clone repository
@@ -35,5 +33,33 @@ jobs:
3533
- name: Test Deno code
3634
run: deno test
3735

36+
- name: Extract version from code
37+
id: get_version
38+
run: echo "VERSION=$(deno eval 'import { VERSION } from "./version.ts"; console.log(VERSION);')" >> $GITHUB_ENV
39+
40+
- name: Update README with version
41+
run: |
42+
sed -i "s/Version: .*/Version: $VERSION/" README.md
43+
44+
- name: Commit README changes
45+
run: |
46+
git config --global user.name "github-actions"
47+
git config --global user.email "[email protected]"
48+
git add README.md
49+
git commit -m "chore: update README to version $VERSION" || echo "No changes to commit"
50+
git push origin main || echo "No changes to push"
51+
3852
- name: Build Deno code
39-
run: deno compile --allow-net --allow-read --allow-write --output=dist/git-mirror git-mirror.ts
53+
run: deno compile --allow-net --allow-read --allow-write --output=dist/git-mirror git-mirror.ts
54+
55+
- name: Create GitHub Release
56+
id: create_release
57+
uses: softprops/action-gh-release@v2
58+
with:
59+
tag_name: v${{ env.VERSION }}
60+
name: Release v${{ env.VERSION }}
61+
draft: false
62+
prerelease: false
63+
files: dist/git-mirror
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)