Skip to content

Commit 2196ef7

Browse files
committed
Attempt Tag and Release workflow for old C gem
1 parent a8f8d76 commit 2196ef7

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

.github/workflows/tag_and_release.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Tag and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- c-api-stable
7+
paths:
8+
- "lib/commonmarker/version.rb"
9+
10+
jobs:
11+
c_gem:
12+
name: Compile C gem
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Ruby
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: 3.1
22+
bundler-cache: true
23+
24+
- name: Compile gem
25+
run: bundle exec rake compile
26+
27+
- name: Build gem
28+
run: bundle exec rake build
29+
30+
- name: Display structure of built gems
31+
run: ls -R
32+
working-directory: pkg/
33+
34+
- name: Publish to RubyGems
35+
working-directory: pkg/
36+
env:
37+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_API_BOT_KEY}}
38+
run: |
39+
mkdir -p $HOME/.gem
40+
touch $HOME/.gem/credentials
41+
chmod 0600 $HOME/.gem/credentials
42+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
43+
for i in *.gem; do
44+
if [ -f "$i" ]
45+
then
46+
gem push "$i" || true
47+
fi
48+
done
49+
50+
# release:
51+
# needs: ["c_gem"]
52+
# env:
53+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
# runs-on: ubuntu-latest
55+
# steps:
56+
# - uses: actions/checkout@v3
57+
58+
# - name: Set up Ruby 3.1
59+
# uses: ruby/setup-ruby@v1
60+
# with:
61+
# rubygems: latest
62+
# ruby-version: 3.1
63+
# bundler-cache: true
64+
65+
# - name: Configure Git
66+
# run: |
67+
# git config --local user.email "[email protected]"
68+
# git config --local user.name "Actions Auto Build"
69+
70+
# - name: Get current version
71+
# id: version-label
72+
# run: |
73+
# VERSION=$(grep VERSION lib/commonmarker/version.rb | head -n 1 | cut -d'"' -f2)
74+
# echo "version=${VERSION}" >> $GITHUB_OUTPUT
75+
76+
# - name: Create tag
77+
# run: |
78+
# git tag -a v${{ steps.version-label.outputs.version }} -m "Release v${{ steps.version-label.outputs.version }}"
79+
# git push origin --tags
80+
81+
# - name: Publish release
82+
# env:
83+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
# run: |
85+
# gh release create v${{ steps.version-label.outputs.version }} --generate-notes

0 commit comments

Comments
 (0)